namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0001 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.AcmMasAccount", "UpperAccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.AcmMasAccount", "VersionId", "dbo.AcmMasAccountVersion");
            DropForeignKey("dbo.AcmTransection", "TransferId", "dbo.FimTransfer");
            DropForeignKey("dbo.AcmTransection", "WorkAreaId", "dbo.HrmMasWorkArea");
            DropForeignKey("dbo.AcmTransection", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimTransfer", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimTransfer", "WorkAreaId", "dbo.HrmMasWorkArea");
            DropForeignKey("dbo.FimTransfer", "FromBankAccId", "dbo.FimMasBankAccount");
            DropForeignKey("dbo.FimTransfer", "ToBankAccId", "dbo.FimMasBankAccount");
            DropForeignKey("dbo.FimTransfer", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.bgm_mas_source", "upper_bgm_source_seq", "dbo.bgm_mas_source");
            DropForeignKey("dbo.bgm_mas_source", "bgm_source_type_seq", "dbo.bgm_mas_source_type");
            DropForeignKey("dbo.bgm_mas_source", "bgm_year_type_seq", "dbo.SysYearType");
            DropForeignKey("dbo.HrmMasWorkArea", "ScopeId", "dbo.HrmMasScope");
            DropForeignKey("dbo.HrmMasScope", "MasScope_ScopeId", "dbo.HrmMasScope");
            DropForeignKey("dbo.FimMasBankAccount", "BranchId", "dbo.FimMasBankBranch");
            DropForeignKey("dbo.FimMasBankAccount", "BgmSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimMasBankAccount", "SavingBankAccId", "dbo.FimMasBankAccount");
            DropForeignKey("dbo.FimMasBankAccount", "BankAccTypeId", "dbo.FimMasLookUp");
            DropForeignKey("dbo.FimMasBankAccount", "AccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.FimMasBankAccount", "WorkAreaId", "dbo.HrmMasWorkArea");
            DropForeignKey("dbo.FimMasBankBranch", "BankId", "dbo.FimMasBank");
            DropForeignKey("dbo.FimMasLookUp", "LookUpTypeId", "dbo.FimMasLookUpType");
            DropForeignKey("dbo.HrmEmployee", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmEmployee", "GenderId", "dbo.HrmMasGender");
            DropForeignKey("dbo.HrmEmployee", "ReligionId", "dbo.HrmMasReligion");
            DropForeignKey("dbo.HrmEmployee", "RaceNationalId", "dbo.HrmMasNationality");
            DropForeignKey("dbo.HrmEmployee", "NationalId", "dbo.HrmMasNationality");
            DropForeignKey("dbo.HrmEmployee", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmEmployee", "ClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmEmployee", "PosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmEmployee", "WorkingJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmEmployee", "EmpStatusId", "dbo.HrmMasEmployeeStatus");
            DropForeignKey("dbo.HrmEmployee", "ExecPosId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmEmployee", "MaritalStatusId", "dbo.HrmMasMaritalStatus");
            DropForeignKey("dbo.HrmMasNamePrefix", "GenderId", "dbo.HrmMasGender");
            DropForeignKey("dbo.HrmMasEmployeeType", "YearTypeId", "dbo.SysYearType");
            DropForeignKey("dbo.HrmMasClass", "PosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmMasClass", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmMasPositionType", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPosition", "UpperPosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPosition", "WorkingUpperPosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPosition", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPosition", "FieldPosId", "dbo.HrmFieldPosition");
            DropForeignKey("dbo.HrmPosition", "ExecPosId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmPosition", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPosition", "PosStatusId", "dbo.HrmMasPositionStatus");
            DropForeignKey("dbo.HrmPosition", "Position_PosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPosition", "Position_PosId1", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmJobSite", "UpperJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmJobSite", "JobSiteTypeId", "dbo.HrmMasJobSiteType");
            DropForeignKey("dbo.HrmJobSite", "WorkAreaId", "dbo.HrmMasWorkArea");
            DropForeignKey("dbo.HrmJobSite", "JobSiteLevelId", "dbo.HrmMasJobSiteLevel");
            DropForeignKey("dbo.HrmJobSite", "DistrictId", "dbo.HrmMasDistrict");
            DropForeignKey("dbo.HrmJobSite", "ProvnceId", "dbo.HrmMasProvince");
            DropForeignKey("dbo.HrmJobSite", "CityId", "dbo.HrmMasCity");
            DropForeignKey("dbo.HrmJobSite", "CountryId", "dbo.HrmMasCountry");
            DropForeignKey("dbo.HrmJobSite", "JobSiteStatusId", "dbo.HrmMasJobSiteStatus");
            DropForeignKey("dbo.HrmJobSite", "JobSite_JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmJobSite", "MpJobSiteType_JobSiteTypeId", "dbo.HrmMpJobSiteType");
            DropForeignKey("dbo.HrmMasJobSiteType", "CurrentJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMasDistrict", "AmphurId", "dbo.HrmMasAmphur");
            DropForeignKey("dbo.HrmMasAmphur", "ProvinceId", "dbo.HrmMasProvince");
            DropForeignKey("dbo.HrmMasCity", "CountryId", "dbo.HrmMasCountry");
            DropForeignKey("dbo.HrmFieldPosition", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmFieldPosition", "PosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmFieldPosition", "ClassSpecId", "dbo.HrmMasClassSpecification");
            DropForeignKey("dbo.AcmTransectionDtl", "TranId", "dbo.AcmTransection");
            DropForeignKey("dbo.AcmTransectionDtl", "AccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.bgm_mas_expense", "upper_bgm_exp_seq", "dbo.bgm_mas_expense");
            DropForeignKey("dbo.bgm_mas_expense", "bgm_exp_grp_seq", "dbo.bgm_mas_expense_group");
            DropForeignKey("dbo.bgm_mas_expense", "bgm_exp_grp_id_real", "dbo.bgm_mas_expense_group");
            DropForeignKey("dbo.bgm_mas_expense", "account_seq", "dbo.AcmMasAccount");
            DropForeignKey("dbo.bgm_mas_expense_source", "bgm_exp_seq", "dbo.bgm_mas_expense");
            DropForeignKey("dbo.bgm_mas_expense_source", "bgm_source_seq", "dbo.bgm_mas_source");
            DropForeignKey("dbo.bgm_project_expense", "bgm_proj_seq", "dbo.bgm_project");
            DropForeignKey("dbo.bgm_project_expense", "bgm_source_seq", "dbo.bgm_mas_source");
            DropForeignKey("dbo.bgm_project_expense", "bgm_exp_seq", "dbo.bgm_mas_expense");
            DropForeignKey("dbo.bgm_project_expense", "icm_res_item_seq", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmMasResourceItem", "ResSubGrpId", "dbo.IcmMasResourceSubGroup");
            DropForeignKey("dbo.IcmMasResourceItem", "UnitId", "dbo.IcmMasUnit");
            DropForeignKey("dbo.IcmMasResourceSubGroup", "ResGrpId", "dbo.IcmMasResourceGroup");
            DropForeignKey("dbo.IcmMasResourceSubGroup", "DpTypeId", "dbo.IcmMasDepreciationType");
            DropForeignKey("dbo.IcmMasResourceGroup", "ResTypeId", "dbo.IcmMasResourceType");
            DropForeignKey("dbo.IcmMasResourceGroup", "DpTypeId", "dbo.IcmMasDepreciationType");
            DropForeignKey("dbo.IcmMasResourceGroup", "AssetAccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.IcmMasResourceGroup", "DepreAccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.IcmMasResourceGroup", "BreakAccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.IcmMasResourceGroup", "ConsumeAccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.IcmMasResourceGroup", "CumdepreAccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.bgm_project_activity_plan", "bgm_proj_seq", "dbo.bgm_project");
            DropForeignKey("dbo.bgm_project_manager", "bgm_proj_seq", "dbo.bgm_project");
            DropForeignKey("dbo.bgm_project_manager", "emp_seq", "dbo.HrmEmployee");
            DropForeignKey("dbo.bgm_project_option", "bgm_option_seq", "dbo.bgm_mas_option");
            DropForeignKey("dbo.bgm_project_option", "bgm_proj_seq", "dbo.bgm_project");
            DropForeignKey("dbo.bgm_mas_option", "upper_bgm_option_seq", "dbo.bgm_mas_option");
            DropForeignKey("dbo.bgm_mas_option", "job_site_seq", "dbo.HrmJobSite");
            DropForeignKey("dbo.bgm_mas_option", "bgm_option_type_seq", "dbo.bgm_system_option_type");
            DropForeignKey("dbo.bgm_project_report", "bgm_proj_exp_seq", "dbo.bgm_project_expense");
            DropForeignKey("dbo.bgm_project_report", "bgm_proj_oper_exp_seq", "dbo.bgm_project_operation_expense");
            DropForeignKey("dbo.bgm_project_operation_expense", "bgm_proj_oper_seq", "dbo.bgm_project_operation");
            DropForeignKey("dbo.bgm_project_operation_expense", "bgm_proj_exp_seq", "dbo.bgm_project_expense");
            DropForeignKey("dbo.bgm_project_operation", "bgm_proj_seq", "dbo.bgm_project");
            DropForeignKey("dbo.bgm_project_operation", "emp_seq", "dbo.HrmEmployee");
            DropForeignKey("dbo.bgm_project_operation", "job_site_seq", "dbo.HrmJobSite");
            DropForeignKey("dbo.bgm_project_operation_person", "bgm_proj_oper_seq", "dbo.bgm_project_operation");
            DropForeignKey("dbo.bgm_project_operation_person", "emp_seq", "dbo.HrmEmployee");
            DropForeignKey("dbo.bgm_project_operation_person", "ContactId", "dbo.IcmMasContact");
            DropForeignKey("dbo.IcmMasContact", "ConGrpId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmMasContact", "ConStatusId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmMasContact", "VatTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmMasLookUp", "LookUpTypeId", "dbo.IcmMasLookUpType");
            DropForeignKey("dbo.bgm_project_operation_report", "bgm_proj_oper_exp_seq", "dbo.bgm_project_operation_expense");
            DropForeignKey("dbo.bgm_project_operation_report", "icm_ppr_item_seq", "dbo.IcmPrePurchaseRequestItem");
            DropForeignKey("dbo.bgm_project_operation_report", "icm_pr_item_seq", "dbo.IcmPurchaseRequestItem");
            DropForeignKey("dbo.bgm_project_operation_report", "icm_po_install_item_seq", "dbo.IcmPurchaseOrderInstallmentItem");
            DropForeignKey("dbo.bgm_project_operation_report", "icm_dn_item_seq", "dbo.IcmDeliveryNoteItem");
            DropForeignKey("dbo.bgm_project_operation_report", "money_req_dtls_seq", "dbo.FimPayRequestDtl");
            DropForeignKey("dbo.bgm_project_operation_report", "return_dtls_seq", "dbo.FimReturnDtl");
            DropForeignKey("dbo.bgm_project_operation_report", "petition_dtls_seq", "dbo.FimPetitionDtl");
            DropForeignKey("dbo.bgm_project_operation_report", "pay_seq", "dbo.FimPay");
            DropForeignKey("dbo.IcmPrePurchaseRequestItem", "ProjOperExpId", "dbo.bgm_project_operation_expense");
            DropForeignKey("dbo.IcmPrePurchaseRequestItem", "RegularId", "dbo.IcmMasPurchaseRegular");
            DropForeignKey("dbo.IcmPrePurchaseRequestItem", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmPrePurchaseRequestItem", "PprId", "dbo.IcmPrePurchaseRequest");
            DropForeignKey("dbo.IcmPrePurchaseRequestItem", "PrItemId", "dbo.IcmPurchaseRequestItem");
            DropForeignKey("dbo.IcmPrePurchaseRequestItem", "BgExpId", "dbo.bgm_mas_expense");
            DropForeignKey("dbo.IcmPrePurchaseRequestItem", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "PcTypeId", "dbo.IcmMasPurchaseType");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "YearTypeId", "dbo.SysYearType");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "RequestEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "RequestJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "PriorityId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "DurTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "DurCountId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPrePurchaseRequest", "ProgressId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPurchaseRequestItem", "PrId", "dbo.IcmPurchaseRequest");
            DropForeignKey("dbo.IcmPurchaseRequestItem", "BgExpId", "dbo.bgm_mas_expense");
            DropForeignKey("dbo.IcmPurchaseRequestItem", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmPurchaseRequest", "RegularId", "dbo.IcmMasPurchaseRegular");
            DropForeignKey("dbo.IcmPurchaseRequest", "PcTypeId", "dbo.IcmMasPurchaseType");
            DropForeignKey("dbo.IcmPurchaseRequest", "PcMethodId", "dbo.IcmMasPurchaseMethod");
            DropForeignKey("dbo.IcmPurchaseRequest", "YearTypeId", "dbo.SysYearType");
            DropForeignKey("dbo.IcmPurchaseRequest", "PurchaseEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmPurchaseRequest", "PurchaseJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmPurchaseRequest", "ConfirmEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmPurchaseRequest", "CancelEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmPurchaseRequest", "PriorityId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPurchaseRequest", "DurTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPurchaseRequest", "DurCountId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPurchaseRequest", "ProgressId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmMasPurchaseMethod", "PcTypeId", "dbo.IcmMasPurchaseType");
            DropForeignKey("dbo.IcmPurchaseOrderInstallmentItem", "BidderQuoId", "dbo.IcmBidderQuotation");
            DropForeignKey("dbo.IcmPurchaseOrderInstallmentItem", "PoInstallId", "dbo.IcmPurchaseOrderInstallment");
            DropForeignKey("dbo.IcmBidderQuotation", "BidderId", "dbo.IcmBidder");
            DropForeignKey("dbo.IcmBidderQuotation", "PrItemId", "dbo.IcmPurchaseRequestItem");
            DropForeignKey("dbo.IcmBidder", "ConId", "dbo.IcmMasContact");
            DropForeignKey("dbo.IcmBidder", "BidId", "dbo.IcmBid");
            DropForeignKey("dbo.IcmBidder", "PrId", "dbo.IcmPurchaseRequest");
            DropForeignKey("dbo.IcmBidder", "DurTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmBidder", "VatTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmBid", "PrId", "dbo.IcmPurchaseRequest");
            DropForeignKey("dbo.IcmBid", "YearTypeId", "dbo.SysYearType");
            DropForeignKey("dbo.IcmBid", "BidEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmBid", "BidJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmBid", "ConfirmEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmBid", "CancelEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmPurchaseOrderInstallment", "PoId", "dbo.IcmPurchaseOrder");
            DropForeignKey("dbo.IcmPurchaseOrderInstallment", "DurTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPurchaseOrder", "BidderId", "dbo.IcmBidder");
            DropForeignKey("dbo.IcmPurchaseOrder", "PcTypeId", "dbo.IcmMasPurchaseType");
            DropForeignKey("dbo.IcmPurchaseOrder", "DurTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPurchaseOrder", "ProgressId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmPurchaseOrder", "YearTypeId", "dbo.SysYearType");
            DropForeignKey("dbo.IcmDeliveryNoteItem", "DnId", "dbo.IcmDeliveryNote");
            DropForeignKey("dbo.IcmDeliveryNoteItem", "PoInstallItemId", "dbo.IcmPurchaseOrderInstallmentItem");
            DropForeignKey("dbo.IcmDeliveryNoteItem", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmDeliveryNote", "ProjOperExpId", "dbo.bgm_project_operation_expense");
            DropForeignKey("dbo.IcmDeliveryNote", "PoId", "dbo.IcmPurchaseOrder");
            DropForeignKey("dbo.IcmDeliveryNote", "PoInstallId", "dbo.IcmPurchaseOrderInstallment");
            DropForeignKey("dbo.IcmDeliveryNote", "WhId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmDeliveryNote", "YearTypeId", "dbo.SysYearType");
            DropForeignKey("dbo.IcmDeliveryNote", "DeliveryEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmDeliveryNote", "DeliveryJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmDeliveryNote", "ProgId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmDeliveryNote", "TranGrpId", "dbo.AcmTransectionGroup");
            DropForeignKey("dbo.IcmWarehouse", "ScopeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmWarehouse", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.FimPayRequestDtl", "PayReqId", "dbo.FimPayRequest");
            DropForeignKey("dbo.FimPayRequestDtl", "ProjOperExpId", "dbo.bgm_project_operation_expense");
            DropForeignKey("dbo.FimPayRequestDtl", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.FimPayRequest", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimPayRequest", "WorkAreaId", "dbo.HrmMasWorkArea");
            DropForeignKey("dbo.FimPayRequest", "ExpGrpId", "dbo.bgm_mas_expense_group");
            DropForeignKey("dbo.FimPayRequest", "PayEventId", "dbo.FimMasLookUp");
            DropForeignKey("dbo.FimPayRequest", "AdvanceBgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimPayRequest", "ProjOperId", "dbo.bgm_project_operation");
            DropForeignKey("dbo.FimPayRequest", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.FimPayRequest", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.FimPayRequest", "ContactId", "dbo.IcmMasContact");
            DropForeignKey("dbo.FimPayRequest", "DnId", "dbo.IcmDeliveryNote");
            DropForeignKey("dbo.FimPayRequest", "BorrowTypeId", "dbo.FimMasLookUp");
            DropForeignKey("dbo.FimPayRequest", "DebtorEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.FimPayRequest", "DebtorContactId", "dbo.IcmMasContact");
            DropForeignKey("dbo.FimPayRequest", "TranGrpId", "dbo.AcmTransectionGroup");
            DropForeignKey("dbo.FimReturnDtl", "ReturnId", "dbo.FimReturn");
            DropForeignKey("dbo.FimReturnDtl", "PayReqDtlId", "dbo.FimPayRequestDtl");
            DropForeignKey("dbo.FimReturn", "PayReqId", "dbo.FimPayRequest");
            DropForeignKey("dbo.FimReturn", "TranGrpId", "dbo.AcmTransectionGroup");
            DropForeignKey("dbo.FimPetitionDtl", "PetitionId", "dbo.FimPetition");
            DropForeignKey("dbo.FimPetitionDtl", "PayReqId", "dbo.FimPayRequest");
            DropForeignKey("dbo.FimPetitionDtl", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.FimPetition", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimPetition", "PetitionTypeId", "dbo.FimMasLookUp");
            DropForeignKey("dbo.FimPetition", "TranGrpId", "dbo.AcmTransectionGroup");
            DropForeignKey("dbo.FimPay", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimPay", "WorkAreaId", "dbo.HrmMasWorkArea");
            DropForeignKey("dbo.FimPay", "PayEventId", "dbo.FimMasLookUp");
            DropForeignKey("dbo.FimPay", "PayMethodId", "dbo.FimMasLookUp");
            DropForeignKey("dbo.FimPay", "PayReqId", "dbo.FimPayRequest");
            DropForeignKey("dbo.FimPay", "PetitionId", "dbo.FimPetition");
            DropForeignKey("dbo.FimPay", "PetitionDtlId", "dbo.FimPetitionDtl");
            DropForeignKey("dbo.FimPay", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.FimPay", "ContactId", "dbo.IcmMasContact");
            DropForeignKey("dbo.FimPay", "BidderColId", "dbo.IcmBidderCollateral");
            DropForeignKey("dbo.FimPay", "PostPayId", "dbo.FimPay");
            DropForeignKey("dbo.FimPay", "TranGrpId", "dbo.AcmTransectionGroup");
            DropForeignKey("dbo.IcmBidderCollateral", "ColTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmBidderCollateral", "ColStatusId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmBidderCollateral", "ColCategoryId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmBidderCollateral", "BidderId", "dbo.IcmBidder");
            DropForeignKey("dbo.bgm_strategy_data_list", "bgm_strat_type_seq", "dbo.bgm_mas_strategy_type");
            DropForeignKey("dbo.FimMasExpenseRate", "BgExpId", "dbo.bgm_mas_expense");
            DropForeignKey("dbo.FimMasExpenseRate", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimMasReceiveType", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimMasReceiveType", "BankAccId", "dbo.FimMasBankAccount");
            DropForeignKey("dbo.FimMasReceiveType", "AccountId", "dbo.AcmMasAccount");
            DropForeignKey("dbo.FimMasBorrowType", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimChequeBook", "BankAccId", "dbo.FimMasBankAccount");
            DropForeignKey("dbo.FimCheque", "ChequeBookId", "dbo.FimChequeBook");
            DropForeignKey("dbo.FimPayRequestDtlRate", "PayRequestDtlId", "dbo.FimPayRequestDtl");
            DropForeignKey("dbo.FimPayCheque", "PayId", "dbo.FimPay");
            DropForeignKey("dbo.FimPayCheque", "ChequeId", "dbo.FimCheque");
            DropForeignKey("dbo.FimReceive", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.FimReceive", "WorkAreaId", "dbo.HrmMasWorkArea");
            DropForeignKey("dbo.FimReceive", "ReceiveTypeId", "dbo.FimMasReceiveType");
            DropForeignKey("dbo.FimReceive", "ReceiveMethodId", "dbo.FimMasLookUp");
            DropForeignKey("dbo.FimReceive", "BranchId", "dbo.FimMasBankBranch");
            DropForeignKey("dbo.FimReceive", "BankAccId", "dbo.FimMasBankAccount");
            DropForeignKey("dbo.FimReceive", "ContactId", "dbo.IcmMasContact");
            DropForeignKey("dbo.FimReceive", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.FimReceive", "BidderId", "dbo.IcmBidder");
            DropForeignKey("dbo.FimReceive", "BidOfferColId", "dbo.IcmBidderCollateral");
            DropForeignKey("dbo.FimReceive", "PoColId", "dbo.IcmBidderCollateral");
            DropForeignKey("dbo.FimReceive", "PrePayColId", "dbo.IcmBidderCollateral");
            DropForeignKey("dbo.FimReceive", "DnPenId", "dbo.IcmDeliveryNotePenalty");
            DropForeignKey("dbo.FimReceive", "PoInstalId", "dbo.IcmPurchaseOrderInstallment");
            DropForeignKey("dbo.FimReceive", "TranGrpId", "dbo.AcmTransectionGroup");
            DropForeignKey("dbo.FimReceive", "TransferId", "dbo.FimTransfer");
            DropForeignKey("dbo.FimReceive", "PetitionId", "dbo.FimPetition");
            DropForeignKey("dbo.FimReceive", "PayReqId", "dbo.FimPayRequest");
            DropForeignKey("dbo.FimReceive", "PayId", "dbo.FimPay");
            DropForeignKey("dbo.IcmDeliveryNotePenalty", "DnId", "dbo.IcmDeliveryNote");
            DropForeignKey("dbo.IcmDeliveryNotePenalty", "PoPenId", "dbo.IcmPurchaseOrderPenalty");
            DropForeignKey("dbo.IcmPurchaseOrderPenalty", "PoId", "dbo.IcmPurchaseOrder");
            DropForeignKey("dbo.IcmPurchaseOrderPenalty", "RateTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.FimEmployeeTax", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.FimEmployeeTax", "FundTypeId", "dbo.FimMasFund");
            DropForeignKey("dbo.FimMasFund", "ConId", "dbo.IcmMasContact");
            DropForeignKey("dbo.IcmMasPurchaseRegularMapping", "RegularId", "dbo.IcmMasPurchaseRegular");
            DropForeignKey("dbo.IcmMasPurchaseRegularMapping", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.IcmMasContactBank", "ConId", "dbo.IcmMasContact");
            DropForeignKey("dbo.IcmMasContactBank", "BranchId", "dbo.FimMasBankBranch");
            DropForeignKey("dbo.IcmMasContactPartner", "ConId", "dbo.IcmMasContact");
            DropForeignKey("dbo.IcmReceive", "WhId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmReceive", "DnId", "dbo.IcmDeliveryNote");
            DropForeignKey("dbo.IcmReceive", "ReceiveTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmWarehousePermit", "WhId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmWarehousePermit", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmReceiveDtl", "ReceiveId", "dbo.IcmReceive");
            DropForeignKey("dbo.IcmReceiveDtl", "ResourceItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmReceiveDtl", "ResourceTypeId", "dbo.IcmMasResourceType");
            DropForeignKey("dbo.IcmReceiveDtl", "UnitId", "dbo.IcmMasUnit");
            DropForeignKey("dbo.IcmReceiveDtl", "ProjExpId", "dbo.bgm_project_expense");
            DropForeignKey("dbo.IcmReceiveDtl", "DepreciationTypeId", "dbo.IcmMasDepreciationType");
            DropForeignKey("dbo.IcmAsset", "ReceiveDtlId", "dbo.IcmReceiveDtl");
            DropForeignKey("dbo.IcmAsset", "ProjExpId", "dbo.bgm_project_expense");
            DropForeignKey("dbo.IcmAsset", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmAsset", "AssetTypeId", "dbo.IcmMasResourceType");
            DropForeignKey("dbo.IcmAsset", "WhId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmAsset", "UnitId", "dbo.IcmMasUnit");
            DropForeignKey("dbo.IcmAsset", "ResSubGrpId", "dbo.IcmMasResourceSubGroup");
            DropForeignKey("dbo.IcmAsset", "ResGrpId", "dbo.IcmMasResourceGroup");
            DropForeignKey("dbo.IcmAsset", "AssetStatusId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmAsset", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmAsset", "DepreciationTypeId", "dbo.IcmMasDepreciationType");
            DropForeignKey("dbo.IcmAssetWarranty", "AssetId", "dbo.IcmAsset");
            DropForeignKey("dbo.IcmOfficeSuppliesLot", "ReceiveDtlId", "dbo.IcmReceiveDtl");
            DropForeignKey("dbo.IcmOfficeSuppliesLot", "WhId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmOfficeSuppliesLot", "UnitId", "dbo.IcmMasUnit");
            DropForeignKey("dbo.IcmOfficeSuppliesLot", "ProjExpId", "dbo.bgm_project_expense");
            DropForeignKey("dbo.IcmOfficeSuppliesLot", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmRequestParcel", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmRequestParcel", "RequestBy", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmRequestParcel", "WarehousePermitId", "dbo.IcmWarehousePermit");
            DropForeignKey("dbo.IcmRequestParcel", "IcmResTypeId", "dbo.IcmMasResourceType");
            DropForeignKey("dbo.IcmRequestParcel", "ProjectId", "dbo.bgm_project");
            DropForeignKey("dbo.IcmRequestParcelDtl", "ReqId", "dbo.IcmRequestParcel");
            DropForeignKey("dbo.IcmRequestParcelDtl", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmRequestParcelDtl", "PprId", "dbo.IcmPrePurchaseRequest");
            DropForeignKey("dbo.IcmRequestParcelDtl", "JobsiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmDispense", "WhId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmDispense", "FromJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmDispense", "RequestById", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmDispense", "RequestParcelId", "dbo.IcmRequestParcel");
            DropForeignKey("dbo.IcmDispense", "ProjectId", "dbo.bgm_project");
            DropForeignKey("dbo.IcmDispenseHistory", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmDispenseHistory", "WhId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmDispenseHistory", "DispenseId", "dbo.IcmDispense");
            DropForeignKey("dbo.IcmMovement", "ResTypeId", "dbo.IcmMasResourceType");
            DropForeignKey("dbo.IcmMovement", "SourceWarehouseId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmMovement", "DestinationWarehouseId", "dbo.IcmWarehouse");
            DropForeignKey("dbo.IcmMovement", "SourceJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.IcmMovementDtl", "MovementId", "dbo.IcmMovement");
            DropForeignKey("dbo.IcmMovementDtl", "AssetId", "dbo.IcmAsset");
            DropForeignKey("dbo.IcmCommittee", "ComFunctionId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmCommittee", "ComPositionId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmCommittee", "ComTypeId", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmCommittee", "RefType", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmCommittee", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmFile", "RefType", "dbo.IcmMasLookUp");
            DropForeignKey("dbo.IcmFile", "Employee_EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.IcmMovementHistory", "AssetId", "dbo.IcmAsset");
            DropForeignKey("dbo.IcmDeliveryNoteItemExtra", "DnId", "dbo.IcmDeliveryNote");
            DropForeignKey("dbo.IcmDeliveryNoteItemExtra", "ResItemId", "dbo.IcmMasResourceItem");
            DropForeignKey("dbo.IcmPurchaseOrderItem", "PoId", "dbo.IcmPurchaseOrder");
            DropForeignKey("dbo.IcmPurchaseOrderItem", "BidderQuoId", "dbo.IcmBidderQuotation");
            DropForeignKey("dbo.SysUser", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.SysMessage", "FromEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.SysMessage", "ToEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.SysUserRole", "UserId", "dbo.SysUser");
            DropForeignKey("dbo.SysUserRole", "PosId", "dbo.HrmPosition");
            DropForeignKey("dbo.SysUserRole", "RoleId", "dbo.SysRole");
            DropForeignKey("dbo.SysUserRole", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.SysPermission", "RoleId", "dbo.SysRole");
            DropForeignKey("dbo.HrmPsCommand", "HrmPsCommandTypes_CmdTypeId", "dbo.HrmPsCommandType");
            DropForeignKey("dbo.HrmPsCommand", "HrmPsEmployeeTypes_EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPsCommand", "HrmMpJobSites_JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommand", "approver_EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsCommand", "HrmDcPenalty_PenId", "dbo.HrmDcPenalty");
            DropForeignKey("dbo.HrmPsCommand", "CmdTypeId", "dbo.HrmPsCommandType");
            DropForeignKey("dbo.HrmPsCommand", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPsCommand", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommand", "PenaltyId", "dbo.HrmDcPenalty");
            DropForeignKey("dbo.HrmPsCommand", "ApprovedId", "dbo.HrmPsCommand");
            DropForeignKey("dbo.HrmPsCommandType", "HrmPsCommandGroups_CmdGroupId", "dbo.HrmPsCommandGroup");
            DropForeignKey("dbo.HrmPsCommandType", "CmdGroupId", "dbo.HrmPsCommandGroup");
            DropForeignKey("dbo.HrmPsCommandDtls", "CmdId", "dbo.HrmPsCommand");
            DropForeignKey("dbo.HrmPsCommandDtls", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpPositions_PosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpClasses_ClassId", "dbo.HrmMpClass");
            DropForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "old_working_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpExecPositions_ExecPosId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpPositions_PosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpClasses_ClassId", "dbo.HrmMpClass");
            DropForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "new_working_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpExecPositions_ExecPosId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "EduHisId", "dbo.HrmPsEduHistory");
            DropForeignKey("dbo.HrmPsCommandDtls", "MoveId", "dbo.HrmEsMoveRequest");
            DropForeignKey("dbo.HrmPsCommandDtls", "OldPosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "OldClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmPsCommandDtls", "OldJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "OldWorkingJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "OldPosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmPsCommandDtls", "OldExecPosId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "NewPosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "NewClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmPsCommandDtls", "NewJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "NewWorkingJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsCommandDtls", "NewPosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmPsCommandDtls", "NewExecPosId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmPsCommandDtls", "EntPosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmPsCommandDtls", "EntClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmPsCommandDtls", "TmpEmpId", "dbo.HrmTmpEmployee");
            DropForeignKey("dbo.HrmPsCommandDtls", "TmpEduId", "dbo.HrmTmpEmployeeEducation");
            DropForeignKey("dbo.HrmPsCommandDtls", "CurrencyId", "dbo.MasCurrency");
            DropForeignKey("dbo.HrmMpClass", "PosTypeId", "dbo.HrmMpPositionType");
            DropForeignKey("dbo.HrmMpClass", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmMpPositionType", "HrmPsEmployeeTypes_EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmMpPositionType", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPsEduHistory", "HrmPsEmployees_EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEduHistory", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEduHistory", "EduDegreeId", "dbo.MasEduDegree");
            DropForeignKey("dbo.HrmPsEduHistory", "EduQualId", "dbo.MasEduQualification");
            DropForeignKey("dbo.HrmPsEduHistory", "EduMajorId", "dbo.MasEduMajor");
            DropForeignKey("dbo.HrmPsEduHistory", "EduInsId", "dbo.MasEduInstitute");
            DropForeignKey("dbo.MasEduQualification", "EduDegreeId", "dbo.MasEduDegree");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduInstitute_EduInsId", "dbo.MasEduInstitute");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduInstitutes_EduInsId", "dbo.MasEduInstitute");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduMajor_EduMajorId", "dbo.MasEduMajor");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduMajors_EduMajorId", "dbo.MasEduMajor");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduQualifications_EduQualId", "dbo.MasEduQualification");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "TmpEmployee_TmpEmpId", "dbo.HrmTmpEmployee");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "HrmTmpEmployees_TmpEmpId", "dbo.HrmTmpEmployee");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "TmpEmpId", "dbo.HrmTmpEmployee");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "EduQualId", "dbo.MasEduQualification");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "EduMajorId", "dbo.MasEduMajor");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "EduInsId", "dbo.MasEduInstitute");
            DropForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduQualification_EduQualId", "dbo.MasEduQualification");
            DropForeignKey("dbo.MasEduInstitute", "DistrictId", "dbo.HrmMasDistrict");
            DropForeignKey("dbo.MasEduInstitute", "CountryId", "dbo.HrmMasCountry");
            DropForeignKey("dbo.MasEduInstitute", "MaxEduDegreeId", "dbo.MasEduDegree");
            DropForeignKey("dbo.HrmTmpEmployee", "NamePrefixId", "dbo.HrmMasNationality");
            DropForeignKey("dbo.HrmTmpEmployee", "GenderId", "dbo.HrmMasGender");
            DropForeignKey("dbo.HrmTmpEmployee", "ReligionId", "dbo.HrmMasReligion");
            DropForeignKey("dbo.HrmTmpEmployee", "RaceNatId", "dbo.HrmMasNationality");
            DropForeignKey("dbo.HrmTmpEmployee", "NatId", "dbo.HrmMasNationality");
            DropForeignKey("dbo.HrmTmpEmployee", "EmpStatusId", "dbo.HrmMasEmployeeStatus");
            DropForeignKey("dbo.HrmTmpEmployee", "BloodGroupId", "dbo.MasBloodGroup");
            DropForeignKey("dbo.HrmTmpEmployee", "MarrStatId", "dbo.HrmMasMaritalStatus");
            DropForeignKey("dbo.HrmTmpEmployee", "EntTypeId", "dbo.HrmRcEntryType");
            DropForeignKey("dbo.HrmTmpEmployee", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmEsMoveRequest", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmEsMoveRequest", "ApprovedId", "dbo.HrmPsCommand");
            DropForeignKey("dbo.HrmPsEmpContact", "HrmPsEmployees_EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpContact", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpContact", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmPsEmpContact", "FamId", "dbo.MasFamilyhood");
            DropForeignKey("dbo.HrmPsEmpContact", "DistrictId", "dbo.HrmMasDistrict");
            DropForeignKey("dbo.HrmEsQuitRequest", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmEsQuitRequest", "ApprovedId", "dbo.HrmPsCommand");
            DropForeignKey("dbo.HrmPsEmployeeType", "YearTypeId", "dbo.SysYearType");
            DropForeignKey("dbo.HrmMpPosition", "FieldPosId", "dbo.HrmFieldPosition");
            DropForeignKey("dbo.HrmMpPosition", "ExecPosId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmMpPosition", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmMpPosition", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMpPosition", "PosUpperId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmMpPosition", "PosWorkingUpperId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmMpPosition", "SkillId", "dbo.HrmPsEmpSkill");
            DropForeignKey("dbo.HrmMpPosition", "CurrencyId", "dbo.MasCurrency");
            DropForeignKey("dbo.HrmPsEmpSkill", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpSkill", "SkillTypeId", "dbo.MasSkillType");
            DropForeignKey("dbo.HrmMpExecPosition", "ExecPosGroupId", "dbo.SysExecPosGroup");
            DropForeignKey("dbo.HrmMpFieldPosition", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmMpFieldPosition", "PosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmMpFieldPosition", "FieldGroupId", "dbo.HrmMpFieldGroup");
            DropForeignKey("dbo.HrmMpFieldPosition", "ClassSpecId", "dbo.HrmMasClassSpecification");
            DropForeignKey("dbo.HrmMpFieldGroup", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmMpFieldDuty", "FieldPosId", "dbo.HrmFieldPosition");
            DropForeignKey("dbo.HrmMpFieldDuty", "ClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmMpFieldDutyDtls", "FieldDutyId", "dbo.HrmMpFieldDuty");
            DropForeignKey("dbo.HrmMpFieldDutyDtls", "DutyId", "dbo.HrmMpDuty");
            DropForeignKey("dbo.HrmMpFieldSpecificationDtls", "FieldSpecId", "dbo.HrmMpFieldSpecification");
            DropForeignKey("dbo.HrmMpFieldSpecificationDtls", "PosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmMpFieldSpecificationDtls", "ClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmMpFieldSpecification", "FieldPosId", "dbo.HrmFieldPosition");
            DropForeignKey("dbo.HrmMpFieldSpecification", "ClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmPsEmpEducation", "HrmPsEmployees_EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpEducation", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpEducation", "EduDegreeId", "dbo.MasEduDegree");
            DropForeignKey("dbo.HrmPsEmpEducation", "EduQualId", "dbo.MasEduQualification");
            DropForeignKey("dbo.HrmPsEmpEducation", "EduInsId", "dbo.MasEduInstitute");
            DropForeignKey("dbo.HrmPsEmpEducation", "EduMajorId", "dbo.MasEduMajor");
            DropForeignKey("dbo.HrmPsEmpEnglish", "HrmPsEmployees_EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpEnglish", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpGoodness", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpIncreases", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "CmdDtlsId", "dbo.HrmPsCommandDtls");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "CmdClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "CmdJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "CmdFieldId", "dbo.HrmFieldPosition");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "CmdExecId", "dbo.HrmPsCommand");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "ClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "MoveId", "dbo.HrmEsMoveRequest");
            DropForeignKey("dbo.HrmPsEmpPositionHistory", "CmdTypeId", "dbo.HrmPsCommandType");
            DropForeignKey("dbo.HrmPsEmpNameHistory", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpNameHistory", "OldPrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmPsEmpNameHistory", "NewPrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmPsEmpSalaryHistory", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpSalaryHistory", "ClassId", "dbo.HrmMpClass");
            DropForeignKey("dbo.HrmPsEmpSalaryHistory", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsEmpSalaryHistory", "MoveId", "dbo.HrmEsMoveRequest");
            DropForeignKey("dbo.HrmPsEmpMovment", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPsEmpSpouse", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpSpouse", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmPsEmpChildren", "HrmPsEmployees_EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpChildren", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpChildren", "GenderId", "dbo.HrmMasGender");
            DropForeignKey("dbo.HrmPsEmpChildren", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmPsEmpChildren", "EduDegreeId", "dbo.MasEduDegree");
            DropForeignKey("dbo.HrmPsEmpChildren", "EduInsId", "dbo.MasEduInstitute");
            DropForeignKey("dbo.HrmPsEmpChildren", "SpouseId", "dbo.HrmChgSpouse");
            DropForeignKey("dbo.HrmChgSpouse", "ChgReqId", "dbo.HrmChgRequest");
            DropForeignKey("dbo.HrmChgSpouse", "SpouseId", "dbo.HrmChgSpouse");
            DropForeignKey("dbo.HrmChgSpouse", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmChgRequest", "ChgTypeId", "dbo.ChgTypes");
            DropForeignKey("dbo.HrmChgRequest", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpParent", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpParent", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmMpJobSiteArea", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMpJobSiteCommand", "JobSiteTypeId", "dbo.HrmMasJobSiteType");
            DropForeignKey("dbo.HrmMpJobSiteCommandDtls", "JobSiteCmdId", "dbo.HrmMpJobSiteCommand");
            DropForeignKey("dbo.HrmMpJobSiteCommandDtls", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMpJobSiteCommandDtls", "FromUpperId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMpJobSiteCommandDtls", "ToUpperId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMpJobSiteCommandDtls", "FromJobSiteLevelId", "dbo.HrmMasJobSiteLevel");
            DropForeignKey("dbo.HrmMpJobSiteCommandDtls", "ToJobSiteLevelId", "dbo.HrmMasJobSiteLevel");
            DropForeignKey("dbo.HrmMpJobSiteType", "current_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMpJobSiteType", "CurrJobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsEmpLegatee", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpLegatee", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmPsEmpLegatee", "FamId", "dbo.MasFamilyhood");
            DropForeignKey("dbo.MasRegion", "CountryId", "dbo.HrmMasCountry");
            DropForeignKey("dbo.HrmPsNwdJobSite", "NonWorkingId", "dbo.HrmPsNonWorkingDay");
            DropForeignKey("dbo.HrmPsNwdJobSite", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmMpPositionDuty", "PosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmMpPositionDuty", "DutyId", "dbo.HrmMpDuty");
            DropForeignKey("dbo.HrmMpPositionDutyDtls", "PosDutyId", "dbo.HrmMpPositionDuty");
            DropForeignKey("dbo.HrmPrExtraType", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPrExtraType", "CmdTypeId", "dbo.HrmPsCommandType");
            DropForeignKey("dbo.HrmPrExtraType", "ContactId", "dbo.IcmMasContact");
            DropForeignKey("dbo.HrmRcCatalog", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPsRetirement", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPsRetirement", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsRetirementDtls", "RetireId", "dbo.HrmPsRetirement");
            DropForeignKey("dbo.HrmPsRetirementDtls", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsRoyalItemControl", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsRoyalItemControl", "RoyalItemId", "dbo.HrmPsRoyalItem");
            DropForeignKey("dbo.HrmPsRoyalItem", "RoyalItemTypeId", "dbo.HrmPsRoyalItemType");
            DropForeignKey("dbo.HrmPsRoyalItemHistory", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsRoyalItemHistory", "RoyalItemReqId", "dbo.HrmPsRoyalItemRequest");
            DropForeignKey("dbo.HrmPsRoyalItemHistory", "RoyalItemId", "dbo.HrmPsRoyalItem");
            DropForeignKey("dbo.HrmPsRoyalItemRequest", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsRoyalItemRequest", "RoyalItemId", "dbo.HrmPsRoyalItem");
            DropForeignKey("dbo.HrmPsRoyalItemRequest", "CurrRoyalItemId", "dbo.HrmPsRoyalItem");
            DropForeignKey("dbo.HrmPsRoyalItemRequest", "PosId", "dbo.HrmPosition");
            DropForeignKey("dbo.HrmPsRoyalItemRequest", "ClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmPsRoyalItemRequest", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsRoyalItemRepayDtls", "RepayId", "dbo.HrmPsRoyalItemRepay");
            DropForeignKey("dbo.HrmPsRoyalItemRepayDtls", "RoyalItemId", "dbo.HrmPsRoyalItem");
            DropForeignKey("dbo.HrmPsRoyalItemRepayDtls", "GenderId", "dbo.HrmMasGender");
            DropForeignKey("dbo.HrmPrSalaryGroup", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPrSalaryGroup", "PosTypeId", "dbo.HrmMasPositionType");
            DropForeignKey("dbo.HrmPrSalaryGroup", "ClassId", "dbo.HrmMasClass");
            DropForeignKey("dbo.HrmScUser", "ScEmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmScUser", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsEmpSpecialExpert", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpSpecialSkill", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsEmpSpecialSkill", "SkillTypeId", "dbo.MasSkillType");
            DropForeignKey("dbo.HrmPsTimeAttendant", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmTrainingRequest", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmTrainingRequest", "StatusId", "dbo.HrmDcStatus");
            DropForeignKey("dbo.HrmTrainingCourse", "TrainingCurId", "dbo.HrmTrainingCurriculum");
            DropForeignKey("dbo.HrmTrainingCourse", "EmpSecId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmTrainingCourse", "ScholarFundId", "dbo.HrmScholarshipFund");
            DropForeignKey("dbo.HrmTrainingCourse", "EpcId", "dbo.HrmExecutivePosition");
            DropForeignKey("dbo.HrmTrainingCourse", "TrainingInsId", "dbo.HrmTrainingInstitute");
            DropForeignKey("dbo.HrmTrainingCourse", "CountryId", "dbo.HrmMasCountry");
            DropForeignKey("dbo.HrmTrainingCourse", "TrainingGroupId", "dbo.HrmTrainingGroup");
            DropForeignKey("dbo.HrmTrainingCourse", "BgSourceId", "dbo.bgm_mas_source");
            DropForeignKey("dbo.HrmTrainingCurriculum", "TrainingTypeId", "dbo.HrmTrainingType");
            DropForeignKey("dbo.HrmTrainingType", "TrainingCatId", "dbo.HrmTrainingTypeCategory");
            DropForeignKey("dbo.HrmScholarshipFund", "ScholarTypeId", "dbo.HrmScholarshipType");
            DropForeignKey("dbo.HrmTrainingInstitute", "CountryId", "dbo.HrmMasCountry");
            DropForeignKey("dbo.HrmTrainingCourseTrainee", "TrainId", "dbo.HrmTrainingRequest");
            DropForeignKey("dbo.HrmTrainingCourseTrainee", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmTrainingCourseTrainee", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmTrainingCourseQuota", "TrainId", "dbo.HrmTrainingRequest");
            DropForeignKey("dbo.HrmTrainingCourseQuota", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmTrainingCourseTrainer", "TrainId", "dbo.HrmTrainingRequest");
            DropForeignKey("dbo.HrmTrainingCourseTrainer", "TrainerId", "dbo.HrmTrainer");
            DropForeignKey("dbo.HrmTrainingCourseTrainer", "TrainingSubjectId", "dbo.HrmTrainingSubject");
            DropForeignKey("dbo.HrmTrainingCourseTrainer", "TrainingSubjectDtlsId", "dbo.HrmTrainingSubjectDtls");
            DropForeignKey("dbo.HrmTrainer", "NamePrefixId", "dbo.HrmMasNamePrefix");
            DropForeignKey("dbo.HrmTrainer", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmTrainer", "DistrictId", "dbo.HrmMasDistrict");
            DropForeignKey("dbo.HrmTrainingSubjectDtls", "TrainingSubjectId", "dbo.HrmTrainingSubject");
            DropForeignKey("dbo.HrmScholarship", "ScholarTypeId", "dbo.HrmScholarshipType");
            DropForeignKey("dbo.HrmScholarship", "ScholarFundId", "dbo.HrmScholarshipFund");
            DropForeignKey("dbo.HrmScholarship", "EduDegreeId", "dbo.MasEduDegree");
            DropForeignKey("dbo.HrmScholarship", "CountryId", "dbo.HrmMasCountry");
            DropForeignKey("dbo.HrmScholarshipGroup", "ScholarId", "dbo.HrmScholarship");
            DropForeignKey("dbo.HrmScholarshipGroupDtls", "EduMajorId", "dbo.MasEduMajor");
            DropForeignKey("dbo.HrmScholarshipGroupDtls", "ScholarId", "dbo.HrmScholarship");
            DropForeignKey("dbo.HrmScholarshipRequest", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmScholarshipRequest", "ScholarId", "dbo.HrmScholarship");
            DropForeignKey("dbo.HrmScholarshipRequest", "EduInsId", "dbo.HrmPsEmpEducation");
            DropForeignKey("dbo.HrmScholarshipRequest", "EduMajorId", "dbo.MasEduMajor");
            DropForeignKey("dbo.HrmScholarshipRequest", "ApFhId", "dbo.HrmAprAppraisal");
            DropForeignKey("dbo.HrmScholarshipRequest", "ApCitizenId", "dbo.HrmScholarshipRequest");
            DropForeignKey("dbo.HrmScholarshipRequest", "ApContactDistrictId", "dbo.HrmMasDistrict");
            DropForeignKey("dbo.HrmScholarshipRequest", "EduQualId", "dbo.MasEduQualification");
            DropForeignKey("dbo.HrmScholarshipRequest", "ResponseTypeId", "dbo.HrmEsResponse");
            DropForeignKey("dbo.HrmScholarshipRequest", "ScholarGroupId", "dbo.HrmScholarshipGroup");
            DropForeignKey("dbo.HrmAprAppraisal", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmAprAppraisal", "StdScoreId", "dbo.HrmAppraisalStdScore");
            DropForeignKey("dbo.HrmEsResponse", "MailId", "dbo.HrmEsMail");
            DropForeignKey("dbo.HrmEsResponse", "RespNextId", "dbo.HrmEsResponse");
            DropForeignKey("dbo.HrmEsMail", "MailTypeId", "dbo.HrmEsMail");
            DropForeignKey("dbo.HrmEsMail", "SenderId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmEsMail", "ReceiverId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmEsMail", "ReqId", "dbo.bgm_request");
            DropForeignKey("dbo.bgm_request", "bgm_strat_list_seq", "dbo.bgm_strategy_data_list");
            DropForeignKey("dbo.bgm_request", "prj_type_seq", "dbo.bgm_project_type");
            DropForeignKey("dbo.bgm_request", "job_site_seq", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmPsAbsence", "AbsenceTypeId", "dbo.HrmPsAbsenceType");
            DropForeignKey("dbo.HrmPsAbsence", "EmpId", "dbo.HrmEmployee");
            DropForeignKey("dbo.HrmPsAbsenceRule", "EmpTypeId", "dbo.HrmMasEmployeeType");
            DropForeignKey("dbo.HrmPsAbsenceRule", "AbsenceTypeId", "dbo.HrmPsAbsenceType");
            DropForeignKey("dbo.HrmActivity", "BgmProjOperId", "dbo.bgm_project_operation");
            DropForeignKey("dbo.HrmActivity", "ActTypeId", "dbo.HrmActivityType");
            DropForeignKey("dbo.HrmActivity", "JobSiteId", "dbo.HrmJobSite");
            DropForeignKey("dbo.HrmActivity", "CityId", "dbo.HrmMasCity");
            DropForeignKey("dbo.HrmActivityRequest", "ActId", "dbo.HrmActivity");
            DropForeignKey("dbo.HrmActivityRequest", "EmpId", "dbo.HrmEmployee");
            DropIndex("dbo.AcmMasAccount", new[] { "UpperAccountId" });
            DropIndex("dbo.AcmMasAccount", new[] { "VersionId" });
            DropIndex("dbo.AcmTransection", new[] { "TransferId" });
            DropIndex("dbo.AcmTransection", new[] { "WorkAreaId" });
            DropIndex("dbo.AcmTransection", new[] { "BgSourceId" });
            DropIndex("dbo.FimTransfer", new[] { "BgSourceId" });
            DropIndex("dbo.FimTransfer", new[] { "WorkAreaId" });
            DropIndex("dbo.FimTransfer", new[] { "FromBankAccId" });
            DropIndex("dbo.FimTransfer", new[] { "ToBankAccId" });
            DropIndex("dbo.FimTransfer", new[] { "EmpId" });
            DropIndex("dbo.bgm_mas_source", new[] { "upper_bgm_source_seq" });
            DropIndex("dbo.bgm_mas_source", new[] { "bgm_source_type_seq" });
            DropIndex("dbo.bgm_mas_source", new[] { "bgm_year_type_seq" });
            DropIndex("dbo.HrmMasWorkArea", new[] { "ScopeId" });
            DropIndex("dbo.HrmMasScope", new[] { "MasScope_ScopeId" });
            DropIndex("dbo.FimMasBankAccount", new[] { "BranchId" });
            DropIndex("dbo.FimMasBankAccount", new[] { "BgmSourceId" });
            DropIndex("dbo.FimMasBankAccount", new[] { "SavingBankAccId" });
            DropIndex("dbo.FimMasBankAccount", new[] { "BankAccTypeId" });
            DropIndex("dbo.FimMasBankAccount", new[] { "AccountId" });
            DropIndex("dbo.FimMasBankAccount", new[] { "WorkAreaId" });
            DropIndex("dbo.FimMasBankBranch", new[] { "BankId" });
            DropIndex("dbo.FimMasLookUp", new[] { "LookUpTypeId" });
            DropIndex("dbo.HrmEmployee", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmEmployee", new[] { "GenderId" });
            DropIndex("dbo.HrmEmployee", new[] { "ReligionId" });
            DropIndex("dbo.HrmEmployee", new[] { "RaceNationalId" });
            DropIndex("dbo.HrmEmployee", new[] { "NationalId" });
            DropIndex("dbo.HrmEmployee", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmEmployee", new[] { "ClassId" });
            DropIndex("dbo.HrmEmployee", new[] { "PosId" });
            DropIndex("dbo.HrmEmployee", new[] { "WorkingJobSiteId" });
            DropIndex("dbo.HrmEmployee", new[] { "EmpStatusId" });
            DropIndex("dbo.HrmEmployee", new[] { "ExecPosId" });
            DropIndex("dbo.HrmEmployee", new[] { "MaritalStatusId" });
            DropIndex("dbo.HrmMasNamePrefix", new[] { "GenderId" });
            DropIndex("dbo.HrmMasEmployeeType", new[] { "YearTypeId" });
            DropIndex("dbo.HrmMasClass", new[] { "PosTypeId" });
            DropIndex("dbo.HrmMasClass", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmMasPositionType", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPosition", new[] { "UpperPosId" });
            DropIndex("dbo.HrmPosition", new[] { "WorkingUpperPosId" });
            DropIndex("dbo.HrmPosition", new[] { "JobSiteId" });
            DropIndex("dbo.HrmPosition", new[] { "FieldPosId" });
            DropIndex("dbo.HrmPosition", new[] { "ExecPosId" });
            DropIndex("dbo.HrmPosition", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPosition", new[] { "PosStatusId" });
            DropIndex("dbo.HrmPosition", new[] { "Position_PosId" });
            DropIndex("dbo.HrmPosition", new[] { "Position_PosId1" });
            DropIndex("dbo.HrmJobSite", new[] { "UpperJobSiteId" });
            DropIndex("dbo.HrmJobSite", new[] { "JobSiteTypeId" });
            DropIndex("dbo.HrmJobSite", new[] { "WorkAreaId" });
            DropIndex("dbo.HrmJobSite", new[] { "JobSiteLevelId" });
            DropIndex("dbo.HrmJobSite", new[] { "DistrictId" });
            DropIndex("dbo.HrmJobSite", new[] { "ProvnceId" });
            DropIndex("dbo.HrmJobSite", new[] { "CityId" });
            DropIndex("dbo.HrmJobSite", new[] { "CountryId" });
            DropIndex("dbo.HrmJobSite", new[] { "JobSiteStatusId" });
            DropIndex("dbo.HrmJobSite", new[] { "JobSite_JobSiteId" });
            DropIndex("dbo.HrmJobSite", new[] { "MpJobSiteType_JobSiteTypeId" });
            DropIndex("dbo.HrmMasJobSiteType", new[] { "CurrentJobSiteId" });
            DropIndex("dbo.HrmMasDistrict", new[] { "AmphurId" });
            DropIndex("dbo.HrmMasAmphur", new[] { "ProvinceId" });
            DropIndex("dbo.HrmMasCity", new[] { "CountryId" });
            DropIndex("dbo.HrmFieldPosition", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmFieldPosition", new[] { "PosTypeId" });
            DropIndex("dbo.HrmFieldPosition", new[] { "ClassSpecId" });
            DropIndex("dbo.AcmTransectionDtl", new[] { "TranId" });
            DropIndex("dbo.AcmTransectionDtl", new[] { "AccountId" });
            DropIndex("dbo.bgm_mas_expense", new[] { "upper_bgm_exp_seq" });
            DropIndex("dbo.bgm_mas_expense", new[] { "bgm_exp_grp_seq" });
            DropIndex("dbo.bgm_mas_expense", new[] { "bgm_exp_grp_id_real" });
            DropIndex("dbo.bgm_mas_expense", new[] { "account_seq" });
            DropIndex("dbo.bgm_mas_expense_source", new[] { "bgm_exp_seq" });
            DropIndex("dbo.bgm_mas_expense_source", new[] { "bgm_source_seq" });
            DropIndex("dbo.bgm_project_expense", new[] { "bgm_proj_seq" });
            DropIndex("dbo.bgm_project_expense", new[] { "bgm_source_seq" });
            DropIndex("dbo.bgm_project_expense", new[] { "bgm_exp_seq" });
            DropIndex("dbo.bgm_project_expense", new[] { "icm_res_item_seq" });
            DropIndex("dbo.IcmMasResourceItem", new[] { "ResSubGrpId" });
            DropIndex("dbo.IcmMasResourceItem", new[] { "UnitId" });
            DropIndex("dbo.IcmMasResourceSubGroup", new[] { "ResGrpId" });
            DropIndex("dbo.IcmMasResourceSubGroup", new[] { "DpTypeId" });
            DropIndex("dbo.IcmMasResourceGroup", new[] { "ResTypeId" });
            DropIndex("dbo.IcmMasResourceGroup", new[] { "DpTypeId" });
            DropIndex("dbo.IcmMasResourceGroup", new[] { "AssetAccountId" });
            DropIndex("dbo.IcmMasResourceGroup", new[] { "DepreAccountId" });
            DropIndex("dbo.IcmMasResourceGroup", new[] { "BreakAccountId" });
            DropIndex("dbo.IcmMasResourceGroup", new[] { "ConsumeAccountId" });
            DropIndex("dbo.IcmMasResourceGroup", new[] { "CumdepreAccountId" });
            DropIndex("dbo.bgm_project_activity_plan", new[] { "bgm_proj_seq" });
            DropIndex("dbo.bgm_project_manager", new[] { "bgm_proj_seq" });
            DropIndex("dbo.bgm_project_manager", new[] { "emp_seq" });
            DropIndex("dbo.bgm_project_option", new[] { "bgm_option_seq" });
            DropIndex("dbo.bgm_project_option", new[] { "bgm_proj_seq" });
            DropIndex("dbo.bgm_mas_option", new[] { "upper_bgm_option_seq" });
            DropIndex("dbo.bgm_mas_option", new[] { "job_site_seq" });
            DropIndex("dbo.bgm_mas_option", new[] { "bgm_option_type_seq" });
            DropIndex("dbo.bgm_project_report", new[] { "bgm_proj_exp_seq" });
            DropIndex("dbo.bgm_project_report", new[] { "bgm_proj_oper_exp_seq" });
            DropIndex("dbo.bgm_project_operation_expense", new[] { "bgm_proj_oper_seq" });
            DropIndex("dbo.bgm_project_operation_expense", new[] { "bgm_proj_exp_seq" });
            DropIndex("dbo.bgm_project_operation", new[] { "bgm_proj_seq" });
            DropIndex("dbo.bgm_project_operation", new[] { "emp_seq" });
            DropIndex("dbo.bgm_project_operation", new[] { "job_site_seq" });
            DropIndex("dbo.bgm_project_operation_person", new[] { "bgm_proj_oper_seq" });
            DropIndex("dbo.bgm_project_operation_person", new[] { "emp_seq" });
            DropIndex("dbo.bgm_project_operation_person", new[] { "ContactId" });
            DropIndex("dbo.IcmMasContact", new[] { "ConGrpId" });
            DropIndex("dbo.IcmMasContact", new[] { "ConStatusId" });
            DropIndex("dbo.IcmMasContact", new[] { "VatTypeId" });
            DropIndex("dbo.IcmMasLookUp", new[] { "LookUpTypeId" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "bgm_proj_oper_exp_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "icm_ppr_item_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "icm_pr_item_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "icm_po_install_item_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "icm_dn_item_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "money_req_dtls_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "return_dtls_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "petition_dtls_seq" });
            DropIndex("dbo.bgm_project_operation_report", new[] { "pay_seq" });
            DropIndex("dbo.IcmPrePurchaseRequestItem", new[] { "ProjOperExpId" });
            DropIndex("dbo.IcmPrePurchaseRequestItem", new[] { "RegularId" });
            DropIndex("dbo.IcmPrePurchaseRequestItem", new[] { "ResItemId" });
            DropIndex("dbo.IcmPrePurchaseRequestItem", new[] { "PprId" });
            DropIndex("dbo.IcmPrePurchaseRequestItem", new[] { "PrItemId" });
            DropIndex("dbo.IcmPrePurchaseRequestItem", new[] { "BgExpId" });
            DropIndex("dbo.IcmPrePurchaseRequestItem", new[] { "BgSourceId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "PcTypeId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "YearTypeId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "RequestEmpId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "RequestJobSiteId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "PriorityId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "DurTypeId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "DurCountId" });
            DropIndex("dbo.IcmPrePurchaseRequest", new[] { "ProgressId" });
            DropIndex("dbo.IcmPurchaseRequestItem", new[] { "PrId" });
            DropIndex("dbo.IcmPurchaseRequestItem", new[] { "BgExpId" });
            DropIndex("dbo.IcmPurchaseRequestItem", new[] { "ResItemId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "RegularId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "PcTypeId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "PcMethodId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "YearTypeId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "PurchaseEmpId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "PurchaseJobSiteId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "ConfirmEmpId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "CancelEmpId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "PriorityId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "DurTypeId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "DurCountId" });
            DropIndex("dbo.IcmPurchaseRequest", new[] { "ProgressId" });
            DropIndex("dbo.IcmMasPurchaseMethod", new[] { "PcTypeId" });
            DropIndex("dbo.IcmPurchaseOrderInstallmentItem", new[] { "BidderQuoId" });
            DropIndex("dbo.IcmPurchaseOrderInstallmentItem", new[] { "PoInstallId" });
            DropIndex("dbo.IcmBidderQuotation", new[] { "BidderId" });
            DropIndex("dbo.IcmBidderQuotation", new[] { "PrItemId" });
            DropIndex("dbo.IcmBidder", new[] { "ConId" });
            DropIndex("dbo.IcmBidder", new[] { "BidId" });
            DropIndex("dbo.IcmBidder", new[] { "PrId" });
            DropIndex("dbo.IcmBidder", new[] { "DurTypeId" });
            DropIndex("dbo.IcmBidder", new[] { "VatTypeId" });
            DropIndex("dbo.IcmBid", new[] { "PrId" });
            DropIndex("dbo.IcmBid", new[] { "YearTypeId" });
            DropIndex("dbo.IcmBid", new[] { "BidEmpId" });
            DropIndex("dbo.IcmBid", new[] { "BidJobSiteId" });
            DropIndex("dbo.IcmBid", new[] { "ConfirmEmpId" });
            DropIndex("dbo.IcmBid", new[] { "CancelEmpId" });
            DropIndex("dbo.IcmPurchaseOrderInstallment", new[] { "PoId" });
            DropIndex("dbo.IcmPurchaseOrderInstallment", new[] { "DurTypeId" });
            DropIndex("dbo.IcmPurchaseOrder", new[] { "BidderId" });
            DropIndex("dbo.IcmPurchaseOrder", new[] { "PcTypeId" });
            DropIndex("dbo.IcmPurchaseOrder", new[] { "DurTypeId" });
            DropIndex("dbo.IcmPurchaseOrder", new[] { "ProgressId" });
            DropIndex("dbo.IcmPurchaseOrder", new[] { "YearTypeId" });
            DropIndex("dbo.IcmDeliveryNoteItem", new[] { "DnId" });
            DropIndex("dbo.IcmDeliveryNoteItem", new[] { "PoInstallItemId" });
            DropIndex("dbo.IcmDeliveryNoteItem", new[] { "ResItemId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "ProjOperExpId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "PoId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "PoInstallId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "WhId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "YearTypeId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "DeliveryEmpId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "DeliveryJobSiteId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "ProgId" });
            DropIndex("dbo.IcmDeliveryNote", new[] { "TranGrpId" });
            DropIndex("dbo.IcmWarehouse", new[] { "ScopeId" });
            DropIndex("dbo.IcmWarehouse", new[] { "JobSiteId" });
            DropIndex("dbo.FimPayRequestDtl", new[] { "PayReqId" });
            DropIndex("dbo.FimPayRequestDtl", new[] { "ProjOperExpId" });
            DropIndex("dbo.FimPayRequestDtl", new[] { "JobSiteId" });
            DropIndex("dbo.FimPayRequest", new[] { "BgSourceId" });
            DropIndex("dbo.FimPayRequest", new[] { "WorkAreaId" });
            DropIndex("dbo.FimPayRequest", new[] { "ExpGrpId" });
            DropIndex("dbo.FimPayRequest", new[] { "PayEventId" });
            DropIndex("dbo.FimPayRequest", new[] { "AdvanceBgSourceId" });
            DropIndex("dbo.FimPayRequest", new[] { "ProjOperId" });
            DropIndex("dbo.FimPayRequest", new[] { "EmpId" });
            DropIndex("dbo.FimPayRequest", new[] { "JobSiteId" });
            DropIndex("dbo.FimPayRequest", new[] { "ContactId" });
            DropIndex("dbo.FimPayRequest", new[] { "DnId" });
            DropIndex("dbo.FimPayRequest", new[] { "BorrowTypeId" });
            DropIndex("dbo.FimPayRequest", new[] { "DebtorEmpId" });
            DropIndex("dbo.FimPayRequest", new[] { "DebtorContactId" });
            DropIndex("dbo.FimPayRequest", new[] { "TranGrpId" });
            DropIndex("dbo.FimReturnDtl", new[] { "ReturnId" });
            DropIndex("dbo.FimReturnDtl", new[] { "PayReqDtlId" });
            DropIndex("dbo.FimReturn", new[] { "PayReqId" });
            DropIndex("dbo.FimReturn", new[] { "TranGrpId" });
            DropIndex("dbo.FimPetitionDtl", new[] { "PetitionId" });
            DropIndex("dbo.FimPetitionDtl", new[] { "PayReqId" });
            DropIndex("dbo.FimPetitionDtl", new[] { "JobSiteId" });
            DropIndex("dbo.FimPetition", new[] { "BgSourceId" });
            DropIndex("dbo.FimPetition", new[] { "PetitionTypeId" });
            DropIndex("dbo.FimPetition", new[] { "TranGrpId" });
            DropIndex("dbo.FimPay", new[] { "BgSourceId" });
            DropIndex("dbo.FimPay", new[] { "WorkAreaId" });
            DropIndex("dbo.FimPay", new[] { "PayEventId" });
            DropIndex("dbo.FimPay", new[] { "PayMethodId" });
            DropIndex("dbo.FimPay", new[] { "PayReqId" });
            DropIndex("dbo.FimPay", new[] { "PetitionId" });
            DropIndex("dbo.FimPay", new[] { "PetitionDtlId" });
            DropIndex("dbo.FimPay", new[] { "EmpId" });
            DropIndex("dbo.FimPay", new[] { "ContactId" });
            DropIndex("dbo.FimPay", new[] { "BidderColId" });
            DropIndex("dbo.FimPay", new[] { "PostPayId" });
            DropIndex("dbo.FimPay", new[] { "TranGrpId" });
            DropIndex("dbo.IcmBidderCollateral", new[] { "ColTypeId" });
            DropIndex("dbo.IcmBidderCollateral", new[] { "ColStatusId" });
            DropIndex("dbo.IcmBidderCollateral", new[] { "ColCategoryId" });
            DropIndex("dbo.IcmBidderCollateral", new[] { "BidderId" });
            DropIndex("dbo.bgm_strategy_data_list", new[] { "bgm_strat_type_seq" });
            DropIndex("dbo.FimMasExpenseRate", new[] { "BgExpId" });
            DropIndex("dbo.FimMasExpenseRate", new[] { "BgSourceId" });
            DropIndex("dbo.FimMasReceiveType", new[] { "BgSourceId" });
            DropIndex("dbo.FimMasReceiveType", new[] { "BankAccId" });
            DropIndex("dbo.FimMasReceiveType", new[] { "AccountId" });
            DropIndex("dbo.FimMasBorrowType", new[] { "BgSourceId" });
            DropIndex("dbo.FimChequeBook", new[] { "BankAccId" });
            DropIndex("dbo.FimCheque", new[] { "ChequeBookId" });
            DropIndex("dbo.FimPayRequestDtlRate", new[] { "PayRequestDtlId" });
            DropIndex("dbo.FimPayCheque", new[] { "PayId" });
            DropIndex("dbo.FimPayCheque", new[] { "ChequeId" });
            DropIndex("dbo.FimReceive", new[] { "BgSourceId" });
            DropIndex("dbo.FimReceive", new[] { "WorkAreaId" });
            DropIndex("dbo.FimReceive", new[] { "ReceiveTypeId" });
            DropIndex("dbo.FimReceive", new[] { "ReceiveMethodId" });
            DropIndex("dbo.FimReceive", new[] { "BranchId" });
            DropIndex("dbo.FimReceive", new[] { "BankAccId" });
            DropIndex("dbo.FimReceive", new[] { "ContactId" });
            DropIndex("dbo.FimReceive", new[] { "EmpId" });
            DropIndex("dbo.FimReceive", new[] { "BidderId" });
            DropIndex("dbo.FimReceive", new[] { "BidOfferColId" });
            DropIndex("dbo.FimReceive", new[] { "PoColId" });
            DropIndex("dbo.FimReceive", new[] { "PrePayColId" });
            DropIndex("dbo.FimReceive", new[] { "DnPenId" });
            DropIndex("dbo.FimReceive", new[] { "PoInstalId" });
            DropIndex("dbo.FimReceive", new[] { "TranGrpId" });
            DropIndex("dbo.FimReceive", new[] { "TransferId" });
            DropIndex("dbo.FimReceive", new[] { "PetitionId" });
            DropIndex("dbo.FimReceive", new[] { "PayReqId" });
            DropIndex("dbo.FimReceive", new[] { "PayId" });
            DropIndex("dbo.IcmDeliveryNotePenalty", new[] { "DnId" });
            DropIndex("dbo.IcmDeliveryNotePenalty", new[] { "PoPenId" });
            DropIndex("dbo.IcmPurchaseOrderPenalty", new[] { "PoId" });
            DropIndex("dbo.IcmPurchaseOrderPenalty", new[] { "RateTypeId" });
            DropIndex("dbo.FimEmployeeTax", new[] { "EmpId" });
            DropIndex("dbo.FimEmployeeTax", new[] { "FundTypeId" });
            DropIndex("dbo.FimMasFund", new[] { "ConId" });
            DropIndex("dbo.IcmMasPurchaseRegularMapping", new[] { "RegularId" });
            DropIndex("dbo.IcmMasPurchaseRegularMapping", new[] { "BgSourceId" });
            DropIndex("dbo.IcmMasContactBank", new[] { "ConId" });
            DropIndex("dbo.IcmMasContactBank", new[] { "BranchId" });
            DropIndex("dbo.IcmMasContactPartner", new[] { "ConId" });
            DropIndex("dbo.IcmReceive", new[] { "WhId" });
            DropIndex("dbo.IcmReceive", new[] { "DnId" });
            DropIndex("dbo.IcmReceive", new[] { "ReceiveTypeId" });
            DropIndex("dbo.IcmWarehousePermit", new[] { "WhId" });
            DropIndex("dbo.IcmWarehousePermit", new[] { "JobSiteId" });
            DropIndex("dbo.IcmReceiveDtl", new[] { "ReceiveId" });
            DropIndex("dbo.IcmReceiveDtl", new[] { "ResourceItemId" });
            DropIndex("dbo.IcmReceiveDtl", new[] { "ResourceTypeId" });
            DropIndex("dbo.IcmReceiveDtl", new[] { "UnitId" });
            DropIndex("dbo.IcmReceiveDtl", new[] { "ProjExpId" });
            DropIndex("dbo.IcmReceiveDtl", new[] { "DepreciationTypeId" });
            DropIndex("dbo.IcmAsset", new[] { "ReceiveDtlId" });
            DropIndex("dbo.IcmAsset", new[] { "ProjExpId" });
            DropIndex("dbo.IcmAsset", new[] { "ResItemId" });
            DropIndex("dbo.IcmAsset", new[] { "AssetTypeId" });
            DropIndex("dbo.IcmAsset", new[] { "WhId" });
            DropIndex("dbo.IcmAsset", new[] { "UnitId" });
            DropIndex("dbo.IcmAsset", new[] { "ResSubGrpId" });
            DropIndex("dbo.IcmAsset", new[] { "ResGrpId" });
            DropIndex("dbo.IcmAsset", new[] { "AssetStatusId" });
            DropIndex("dbo.IcmAsset", new[] { "JobSiteId" });
            DropIndex("dbo.IcmAsset", new[] { "DepreciationTypeId" });
            DropIndex("dbo.IcmAssetWarranty", new[] { "AssetId" });
            DropIndex("dbo.IcmOfficeSuppliesLot", new[] { "ReceiveDtlId" });
            DropIndex("dbo.IcmOfficeSuppliesLot", new[] { "WhId" });
            DropIndex("dbo.IcmOfficeSuppliesLot", new[] { "UnitId" });
            DropIndex("dbo.IcmOfficeSuppliesLot", new[] { "ProjExpId" });
            DropIndex("dbo.IcmOfficeSuppliesLot", new[] { "ResItemId" });
            DropIndex("dbo.IcmRequestParcel", new[] { "JobSiteId" });
            DropIndex("dbo.IcmRequestParcel", new[] { "RequestBy" });
            DropIndex("dbo.IcmRequestParcel", new[] { "WarehousePermitId" });
            DropIndex("dbo.IcmRequestParcel", new[] { "IcmResTypeId" });
            DropIndex("dbo.IcmRequestParcel", new[] { "ProjectId" });
            DropIndex("dbo.IcmRequestParcelDtl", new[] { "ReqId" });
            DropIndex("dbo.IcmRequestParcelDtl", new[] { "ResItemId" });
            DropIndex("dbo.IcmRequestParcelDtl", new[] { "PprId" });
            DropIndex("dbo.IcmRequestParcelDtl", new[] { "JobsiteId" });
            DropIndex("dbo.IcmDispense", new[] { "WhId" });
            DropIndex("dbo.IcmDispense", new[] { "FromJobSiteId" });
            DropIndex("dbo.IcmDispense", new[] { "RequestById" });
            DropIndex("dbo.IcmDispense", new[] { "RequestParcelId" });
            DropIndex("dbo.IcmDispense", new[] { "ProjectId" });
            DropIndex("dbo.IcmDispenseHistory", new[] { "ResItemId" });
            DropIndex("dbo.IcmDispenseHistory", new[] { "WhId" });
            DropIndex("dbo.IcmDispenseHistory", new[] { "DispenseId" });
            DropIndex("dbo.IcmMovement", new[] { "ResTypeId" });
            DropIndex("dbo.IcmMovement", new[] { "SourceWarehouseId" });
            DropIndex("dbo.IcmMovement", new[] { "DestinationWarehouseId" });
            DropIndex("dbo.IcmMovement", new[] { "SourceJobSiteId" });
            DropIndex("dbo.IcmMovementDtl", new[] { "MovementId" });
            DropIndex("dbo.IcmMovementDtl", new[] { "AssetId" });
            DropIndex("dbo.IcmCommittee", new[] { "ComFunctionId" });
            DropIndex("dbo.IcmCommittee", new[] { "ComPositionId" });
            DropIndex("dbo.IcmCommittee", new[] { "ComTypeId" });
            DropIndex("dbo.IcmCommittee", new[] { "RefType" });
            DropIndex("dbo.IcmCommittee", new[] { "EmpId" });
            DropIndex("dbo.IcmFile", new[] { "RefType" });
            DropIndex("dbo.IcmFile", new[] { "Employee_EmpId" });
            DropIndex("dbo.IcmMovementHistory", new[] { "AssetId" });
            DropIndex("dbo.IcmDeliveryNoteItemExtra", new[] { "DnId" });
            DropIndex("dbo.IcmDeliveryNoteItemExtra", new[] { "ResItemId" });
            DropIndex("dbo.IcmPurchaseOrderItem", new[] { "PoId" });
            DropIndex("dbo.IcmPurchaseOrderItem", new[] { "BidderQuoId" });
            DropIndex("dbo.SysUser", new[] { "EmpId" });
            DropIndex("dbo.SysMessage", new[] { "FromEmpId" });
            DropIndex("dbo.SysMessage", new[] { "ToEmpId" });
            DropIndex("dbo.SysUserRole", new[] { "UserId" });
            DropIndex("dbo.SysUserRole", new[] { "PosId" });
            DropIndex("dbo.SysUserRole", new[] { "RoleId" });
            DropIndex("dbo.SysUserRole", new[] { "EmpTypeId" });
            DropIndex("dbo.SysPermission", new[] { "RoleId" });
            DropIndex("dbo.HrmPsCommand", new[] { "HrmPsCommandTypes_CmdTypeId" });
            DropIndex("dbo.HrmPsCommand", new[] { "HrmPsEmployeeTypes_EmpTypeId" });
            DropIndex("dbo.HrmPsCommand", new[] { "HrmMpJobSites_JobSiteId" });
            DropIndex("dbo.HrmPsCommand", new[] { "approver_EmpId" });
            DropIndex("dbo.HrmPsCommand", new[] { "HrmDcPenalty_PenId" });
            DropIndex("dbo.HrmPsCommand", new[] { "CmdTypeId" });
            DropIndex("dbo.HrmPsCommand", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPsCommand", new[] { "JobSiteId" });
            DropIndex("dbo.HrmPsCommand", new[] { "PenaltyId" });
            DropIndex("dbo.HrmPsCommand", new[] { "ApprovedId" });
            DropIndex("dbo.HrmPsCommandType", new[] { "HrmPsCommandGroups_CmdGroupId" });
            DropIndex("dbo.HrmPsCommandType", new[] { "CmdGroupId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "CmdId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "EmpId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "old_HrmMpPositions_PosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "old_HrmMpClasses_ClassId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "old_HrmMpJobSites_JobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "old_working_HrmMpJobSites_JobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "old_HrmMpExecPositions_ExecPosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "new_HrmMpPositions_PosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "new_HrmMpClasses_ClassId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "new_HrmMpJobSites_JobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "new_working_HrmMpJobSites_JobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "new_HrmMpExecPositions_ExecPosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "EduHisId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "MoveId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "OldPosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "OldClassId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "OldJobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "OldWorkingJobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "OldPosTypeId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "OldExecPosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "NewPosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "NewClassId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "NewJobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "NewWorkingJobSiteId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "NewPosTypeId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "NewExecPosId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "EntPosTypeId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "EntClassId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "TmpEmpId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "TmpEduId" });
            DropIndex("dbo.HrmPsCommandDtls", new[] { "CurrencyId" });
            DropIndex("dbo.HrmMpClass", new[] { "PosTypeId" });
            DropIndex("dbo.HrmMpClass", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmMpPositionType", new[] { "HrmPsEmployeeTypes_EmpTypeId" });
            DropIndex("dbo.HrmMpPositionType", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPsEduHistory", new[] { "HrmPsEmployees_EmpId" });
            DropIndex("dbo.HrmPsEduHistory", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEduHistory", new[] { "EduDegreeId" });
            DropIndex("dbo.HrmPsEduHistory", new[] { "EduQualId" });
            DropIndex("dbo.HrmPsEduHistory", new[] { "EduMajorId" });
            DropIndex("dbo.HrmPsEduHistory", new[] { "EduInsId" });
            DropIndex("dbo.MasEduQualification", new[] { "EduDegreeId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "MasEduInstitute_EduInsId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "MasEduInstitutes_EduInsId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "MasEduMajor_EduMajorId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "MasEduMajors_EduMajorId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "MasEduQualifications_EduQualId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "TmpEmployee_TmpEmpId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "HrmTmpEmployees_TmpEmpId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "TmpEmpId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "EduQualId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "EduMajorId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "EduInsId" });
            DropIndex("dbo.HrmTmpEmployeeEducation", new[] { "MasEduQualification_EduQualId" });
            DropIndex("dbo.MasEduInstitute", new[] { "DistrictId" });
            DropIndex("dbo.MasEduInstitute", new[] { "CountryId" });
            DropIndex("dbo.MasEduInstitute", new[] { "MaxEduDegreeId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "GenderId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "ReligionId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "RaceNatId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "NatId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "EmpStatusId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "BloodGroupId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "MarrStatId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "EntTypeId" });
            DropIndex("dbo.HrmTmpEmployee", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmEsMoveRequest", new[] { "EmpId" });
            DropIndex("dbo.HrmEsMoveRequest", new[] { "ApprovedId" });
            DropIndex("dbo.HrmPsEmpContact", new[] { "HrmPsEmployees_EmpId" });
            DropIndex("dbo.HrmPsEmpContact", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpContact", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmPsEmpContact", new[] { "FamId" });
            DropIndex("dbo.HrmPsEmpContact", new[] { "DistrictId" });
            DropIndex("dbo.HrmEsQuitRequest", new[] { "EmpId" });
            DropIndex("dbo.HrmEsQuitRequest", new[] { "ApprovedId" });
            DropIndex("dbo.HrmPsEmployeeType", new[] { "YearTypeId" });
            DropIndex("dbo.HrmMpPosition", new[] { "FieldPosId" });
            DropIndex("dbo.HrmMpPosition", new[] { "ExecPosId" });
            DropIndex("dbo.HrmMpPosition", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmMpPosition", new[] { "JobSiteId" });
            DropIndex("dbo.HrmMpPosition", new[] { "PosUpperId" });
            DropIndex("dbo.HrmMpPosition", new[] { "PosWorkingUpperId" });
            DropIndex("dbo.HrmMpPosition", new[] { "SkillId" });
            DropIndex("dbo.HrmMpPosition", new[] { "CurrencyId" });
            DropIndex("dbo.HrmPsEmpSkill", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpSkill", new[] { "SkillTypeId" });
            DropIndex("dbo.HrmMpExecPosition", new[] { "ExecPosGroupId" });
            DropIndex("dbo.HrmMpFieldPosition", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmMpFieldPosition", new[] { "PosTypeId" });
            DropIndex("dbo.HrmMpFieldPosition", new[] { "FieldGroupId" });
            DropIndex("dbo.HrmMpFieldPosition", new[] { "ClassSpecId" });
            DropIndex("dbo.HrmMpFieldGroup", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmMpFieldDuty", new[] { "FieldPosId" });
            DropIndex("dbo.HrmMpFieldDuty", new[] { "ClassId" });
            DropIndex("dbo.HrmMpFieldDutyDtls", new[] { "FieldDutyId" });
            DropIndex("dbo.HrmMpFieldDutyDtls", new[] { "DutyId" });
            DropIndex("dbo.HrmMpFieldSpecificationDtls", new[] { "FieldSpecId" });
            DropIndex("dbo.HrmMpFieldSpecificationDtls", new[] { "PosTypeId" });
            DropIndex("dbo.HrmMpFieldSpecificationDtls", new[] { "ClassId" });
            DropIndex("dbo.HrmMpFieldSpecification", new[] { "FieldPosId" });
            DropIndex("dbo.HrmMpFieldSpecification", new[] { "ClassId" });
            DropIndex("dbo.HrmPsEmpEducation", new[] { "HrmPsEmployees_EmpId" });
            DropIndex("dbo.HrmPsEmpEducation", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpEducation", new[] { "EduDegreeId" });
            DropIndex("dbo.HrmPsEmpEducation", new[] { "EduQualId" });
            DropIndex("dbo.HrmPsEmpEducation", new[] { "EduInsId" });
            DropIndex("dbo.HrmPsEmpEducation", new[] { "EduMajorId" });
            DropIndex("dbo.HrmPsEmpEnglish", new[] { "HrmPsEmployees_EmpId" });
            DropIndex("dbo.HrmPsEmpEnglish", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpGoodness", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpIncreases", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "CmdDtlsId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "CmdClassId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "CmdJobSiteId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "CmdFieldId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "CmdExecId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "ClassId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "JobSiteId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "MoveId" });
            DropIndex("dbo.HrmPsEmpPositionHistory", new[] { "CmdTypeId" });
            DropIndex("dbo.HrmPsEmpNameHistory", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpNameHistory", new[] { "OldPrefixId" });
            DropIndex("dbo.HrmPsEmpNameHistory", new[] { "NewPrefixId" });
            DropIndex("dbo.HrmPsEmpSalaryHistory", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpSalaryHistory", new[] { "ClassId" });
            DropIndex("dbo.HrmPsEmpSalaryHistory", new[] { "JobSiteId" });
            DropIndex("dbo.HrmPsEmpSalaryHistory", new[] { "MoveId" });
            DropIndex("dbo.HrmPsEmpMovment", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPsEmpSpouse", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpSpouse", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmPsEmpChildren", new[] { "HrmPsEmployees_EmpId" });
            DropIndex("dbo.HrmPsEmpChildren", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpChildren", new[] { "GenderId" });
            DropIndex("dbo.HrmPsEmpChildren", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmPsEmpChildren", new[] { "EduDegreeId" });
            DropIndex("dbo.HrmPsEmpChildren", new[] { "EduInsId" });
            DropIndex("dbo.HrmPsEmpChildren", new[] { "SpouseId" });
            DropIndex("dbo.HrmChgSpouse", new[] { "ChgReqId" });
            DropIndex("dbo.HrmChgSpouse", new[] { "SpouseId" });
            DropIndex("dbo.HrmChgSpouse", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmChgRequest", new[] { "ChgTypeId" });
            DropIndex("dbo.HrmChgRequest", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpParent", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpParent", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmMpJobSiteArea", new[] { "JobSiteId" });
            DropIndex("dbo.HrmMpJobSiteCommand", new[] { "JobSiteTypeId" });
            DropIndex("dbo.HrmMpJobSiteCommandDtls", new[] { "JobSiteCmdId" });
            DropIndex("dbo.HrmMpJobSiteCommandDtls", new[] { "JobSiteId" });
            DropIndex("dbo.HrmMpJobSiteCommandDtls", new[] { "FromUpperId" });
            DropIndex("dbo.HrmMpJobSiteCommandDtls", new[] { "ToUpperId" });
            DropIndex("dbo.HrmMpJobSiteCommandDtls", new[] { "FromJobSiteLevelId" });
            DropIndex("dbo.HrmMpJobSiteCommandDtls", new[] { "ToJobSiteLevelId" });
            DropIndex("dbo.HrmMpJobSiteType", new[] { "current_HrmMpJobSites_JobSiteId" });
            DropIndex("dbo.HrmMpJobSiteType", new[] { "CurrJobSiteId" });
            DropIndex("dbo.HrmPsEmpLegatee", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpLegatee", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmPsEmpLegatee", new[] { "FamId" });
            DropIndex("dbo.MasRegion", new[] { "CountryId" });
            DropIndex("dbo.HrmPsNwdJobSite", new[] { "NonWorkingId" });
            DropIndex("dbo.HrmPsNwdJobSite", new[] { "JobSiteId" });
            DropIndex("dbo.HrmMpPositionDuty", new[] { "PosId" });
            DropIndex("dbo.HrmMpPositionDuty", new[] { "DutyId" });
            DropIndex("dbo.HrmMpPositionDutyDtls", new[] { "PosDutyId" });
            DropIndex("dbo.HrmPrExtraType", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPrExtraType", new[] { "CmdTypeId" });
            DropIndex("dbo.HrmPrExtraType", new[] { "ContactId" });
            DropIndex("dbo.HrmRcCatalog", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPsRetirement", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPsRetirement", new[] { "JobSiteId" });
            DropIndex("dbo.HrmPsRetirementDtls", new[] { "RetireId" });
            DropIndex("dbo.HrmPsRetirementDtls", new[] { "EmpId" });
            DropIndex("dbo.HrmPsRoyalItemControl", new[] { "EmpId" });
            DropIndex("dbo.HrmPsRoyalItemControl", new[] { "RoyalItemId" });
            DropIndex("dbo.HrmPsRoyalItem", new[] { "RoyalItemTypeId" });
            DropIndex("dbo.HrmPsRoyalItemHistory", new[] { "EmpId" });
            DropIndex("dbo.HrmPsRoyalItemHistory", new[] { "RoyalItemReqId" });
            DropIndex("dbo.HrmPsRoyalItemHistory", new[] { "RoyalItemId" });
            DropIndex("dbo.HrmPsRoyalItemRequest", new[] { "EmpId" });
            DropIndex("dbo.HrmPsRoyalItemRequest", new[] { "RoyalItemId" });
            DropIndex("dbo.HrmPsRoyalItemRequest", new[] { "CurrRoyalItemId" });
            DropIndex("dbo.HrmPsRoyalItemRequest", new[] { "PosId" });
            DropIndex("dbo.HrmPsRoyalItemRequest", new[] { "ClassId" });
            DropIndex("dbo.HrmPsRoyalItemRequest", new[] { "JobSiteId" });
            DropIndex("dbo.HrmPsRoyalItemRepayDtls", new[] { "RepayId" });
            DropIndex("dbo.HrmPsRoyalItemRepayDtls", new[] { "RoyalItemId" });
            DropIndex("dbo.HrmPsRoyalItemRepayDtls", new[] { "GenderId" });
            DropIndex("dbo.HrmPrSalaryGroup", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPrSalaryGroup", new[] { "PosTypeId" });
            DropIndex("dbo.HrmPrSalaryGroup", new[] { "ClassId" });
            DropIndex("dbo.HrmScUser", new[] { "ScEmpId" });
            DropIndex("dbo.HrmScUser", new[] { "JobSiteId" });
            DropIndex("dbo.HrmPsEmpSpecialExpert", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpSpecialSkill", new[] { "EmpId" });
            DropIndex("dbo.HrmPsEmpSpecialSkill", new[] { "SkillTypeId" });
            DropIndex("dbo.HrmPsTimeAttendant", new[] { "EmpId" });
            DropIndex("dbo.HrmTrainingRequest", new[] { "EmpId" });
            DropIndex("dbo.HrmTrainingRequest", new[] { "StatusId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "TrainingCurId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "EmpSecId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "ScholarFundId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "EpcId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "TrainingInsId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "CountryId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "TrainingGroupId" });
            DropIndex("dbo.HrmTrainingCourse", new[] { "BgSourceId" });
            DropIndex("dbo.HrmTrainingCurriculum", new[] { "TrainingTypeId" });
            DropIndex("dbo.HrmTrainingType", new[] { "TrainingCatId" });
            DropIndex("dbo.HrmScholarshipFund", new[] { "ScholarTypeId" });
            DropIndex("dbo.HrmTrainingInstitute", new[] { "CountryId" });
            DropIndex("dbo.HrmTrainingCourseTrainee", new[] { "TrainId" });
            DropIndex("dbo.HrmTrainingCourseTrainee", new[] { "EmpId" });
            DropIndex("dbo.HrmTrainingCourseTrainee", new[] { "JobSiteId" });
            DropIndex("dbo.HrmTrainingCourseQuota", new[] { "TrainId" });
            DropIndex("dbo.HrmTrainingCourseQuota", new[] { "JobSiteId" });
            DropIndex("dbo.HrmTrainingCourseTrainer", new[] { "TrainId" });
            DropIndex("dbo.HrmTrainingCourseTrainer", new[] { "TrainerId" });
            DropIndex("dbo.HrmTrainingCourseTrainer", new[] { "TrainingSubjectId" });
            DropIndex("dbo.HrmTrainingCourseTrainer", new[] { "TrainingSubjectDtlsId" });
            DropIndex("dbo.HrmTrainer", new[] { "NamePrefixId" });
            DropIndex("dbo.HrmTrainer", new[] { "EmpId" });
            DropIndex("dbo.HrmTrainer", new[] { "DistrictId" });
            DropIndex("dbo.HrmTrainingSubjectDtls", new[] { "TrainingSubjectId" });
            DropIndex("dbo.HrmScholarship", new[] { "ScholarTypeId" });
            DropIndex("dbo.HrmScholarship", new[] { "ScholarFundId" });
            DropIndex("dbo.HrmScholarship", new[] { "EduDegreeId" });
            DropIndex("dbo.HrmScholarship", new[] { "CountryId" });
            DropIndex("dbo.HrmScholarshipGroup", new[] { "ScholarId" });
            DropIndex("dbo.HrmScholarshipGroupDtls", new[] { "EduMajorId" });
            DropIndex("dbo.HrmScholarshipGroupDtls", new[] { "ScholarId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "EmpId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "ScholarId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "EduInsId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "EduMajorId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "ApFhId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "ApCitizenId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "ApContactDistrictId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "EduQualId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "ResponseTypeId" });
            DropIndex("dbo.HrmScholarshipRequest", new[] { "ScholarGroupId" });
            DropIndex("dbo.HrmAprAppraisal", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmAprAppraisal", new[] { "StdScoreId" });
            DropIndex("dbo.HrmEsResponse", new[] { "MailId" });
            DropIndex("dbo.HrmEsResponse", new[] { "RespNextId" });
            DropIndex("dbo.HrmEsMail", new[] { "MailTypeId" });
            DropIndex("dbo.HrmEsMail", new[] { "SenderId" });
            DropIndex("dbo.HrmEsMail", new[] { "ReceiverId" });
            DropIndex("dbo.HrmEsMail", new[] { "ReqId" });
            DropIndex("dbo.bgm_request", new[] { "bgm_strat_list_seq" });
            DropIndex("dbo.bgm_request", new[] { "prj_type_seq" });
            DropIndex("dbo.bgm_request", new[] { "job_site_seq" });
            DropIndex("dbo.HrmPsAbsence", new[] { "AbsenceTypeId" });
            DropIndex("dbo.HrmPsAbsence", new[] { "EmpId" });
            DropIndex("dbo.HrmPsAbsenceRule", new[] { "EmpTypeId" });
            DropIndex("dbo.HrmPsAbsenceRule", new[] { "AbsenceTypeId" });
            DropIndex("dbo.HrmActivity", new[] { "BgmProjOperId" });
            DropIndex("dbo.HrmActivity", new[] { "ActTypeId" });
            DropIndex("dbo.HrmActivity", new[] { "JobSiteId" });
            DropIndex("dbo.HrmActivity", new[] { "CityId" });
            DropIndex("dbo.HrmActivityRequest", new[] { "ActId" });
            DropIndex("dbo.HrmActivityRequest", new[] { "EmpId" });
            DropTable("dbo.AcmChangeValue");
            DropTable("dbo.AcmMasAccount");
            DropTable("dbo.AcmMasAccountVersion");
            DropTable("dbo.AcmMasAccounts");
            DropTable("dbo.AcmMasBaseAccount");
            DropTable("dbo.AcmMasFiscalPeriod");
            DropTable("dbo.AcmTransection");
            DropTable("dbo.FimTransfer");
            DropTable("dbo.bgm_mas_source");
            DropTable("dbo.bgm_mas_source_type");
            DropTable("dbo.SysYearType");
            DropTable("dbo.HrmMasWorkArea");
            DropTable("dbo.HrmMasScope");
            DropTable("dbo.FimMasBankAccount");
            DropTable("dbo.FimMasBankBranch");
            DropTable("dbo.FimMasBank");
            DropTable("dbo.FimMasLookUp");
            DropTable("dbo.FimMasLookUpType");
            DropTable("dbo.HrmEmployee");
            DropTable("dbo.HrmMasNamePrefix");
            DropTable("dbo.HrmMasGender");
            DropTable("dbo.HrmMasReligion");
            DropTable("dbo.HrmMasNationality");
            DropTable("dbo.HrmMasEmployeeType");
            DropTable("dbo.HrmMasClass");
            DropTable("dbo.HrmMasPositionType");
            DropTable("dbo.HrmPosition");
            DropTable("dbo.HrmJobSite");
            DropTable("dbo.HrmMasJobSiteType");
            DropTable("dbo.HrmMasJobSiteLevel");
            DropTable("dbo.HrmMasDistrict");
            DropTable("dbo.HrmMasAmphur");
            DropTable("dbo.HrmMasProvince");
            DropTable("dbo.HrmMasCity");
            DropTable("dbo.HrmMasCountry");
            DropTable("dbo.HrmMasJobSiteStatus");
            DropTable("dbo.HrmFieldPosition");
            DropTable("dbo.HrmExecutivePosition");
            DropTable("dbo.HrmMasPositionStatus");
            DropTable("dbo.HrmMasEmployeeStatus");
            DropTable("dbo.HrmMasMaritalStatus");
            DropTable("dbo.AcmTransectionDtl");
            DropTable("dbo.AcmTransectionGroup");
            DropTable("dbo.bgm_mas_expense");
            DropTable("dbo.bgm_mas_expense_group");
            DropTable("dbo.bgm_mas_expense_source");
            DropTable("dbo.bgm_project");
            DropTable("dbo.bgm_project_expense");
            DropTable("dbo.IcmMasResourceItem");
            DropTable("dbo.IcmMasResourceSubGroup");
            DropTable("dbo.IcmMasResourceGroup");
            DropTable("dbo.IcmMasResourceType");
            DropTable("dbo.IcmMasDepreciationType");
            DropTable("dbo.IcmMasUnit");
            DropTable("dbo.bgm_project_activity_plan");
            DropTable("dbo.bgm_project_manager");
            DropTable("dbo.bgm_project_option");
            DropTable("dbo.bgm_mas_option");
            DropTable("dbo.bgm_system_option_type");
            DropTable("dbo.bgm_project_report");
            DropTable("dbo.bgm_project_operation_expense");
            DropTable("dbo.bgm_project_operation");
            DropTable("dbo.bgm_project_operation_person");
            DropTable("dbo.IcmMasContact");
            DropTable("dbo.IcmMasLookUp");
            DropTable("dbo.IcmMasLookUpType");
            DropTable("dbo.bgm_project_operation_report");
            DropTable("dbo.IcmPrePurchaseRequestItem");
            DropTable("dbo.IcmMasPurchaseRegular");
            DropTable("dbo.IcmPrePurchaseRequest");
            DropTable("dbo.IcmMasPurchaseType");
            DropTable("dbo.IcmPurchaseRequestItem");
            DropTable("dbo.IcmPurchaseRequest");
            DropTable("dbo.IcmMasPurchaseMethod");
            DropTable("dbo.IcmPurchaseOrderInstallmentItem");
            DropTable("dbo.IcmBidderQuotation");
            DropTable("dbo.IcmBidder");
            DropTable("dbo.IcmBid");
            DropTable("dbo.IcmPurchaseOrderInstallment");
            DropTable("dbo.IcmPurchaseOrder");
            DropTable("dbo.IcmDeliveryNoteItem");
            DropTable("dbo.IcmDeliveryNote");
            DropTable("dbo.IcmWarehouse");
            DropTable("dbo.FimPayRequestDtl");
            DropTable("dbo.FimPayRequest");
            DropTable("dbo.FimReturnDtl");
            DropTable("dbo.FimReturn");
            DropTable("dbo.FimPetitionDtl");
            DropTable("dbo.FimPetition");
            DropTable("dbo.FimPay");
            DropTable("dbo.IcmBidderCollateral");
            DropTable("dbo.bgm_mas_scopes");
            DropTable("dbo.bgm_project_type");
            DropTable("dbo.bgm_strategy_data_list");
            DropTable("dbo.bgm_mas_strategy_type");
            DropTable("dbo.bgm_system_control");
            DropTable("dbo.FimMasExpenseRate");
            DropTable("dbo.FimMasBankAccountType");
            DropTable("dbo.FimMasBankAccountTypeGroup");
            DropTable("dbo.FimMasReceiveType");
            DropTable("dbo.FimMasBorrowType");
            DropTable("dbo.FimChequeBook");
            DropTable("dbo.FimCheque");
            DropTable("dbo.FimPayRequestDtlRate");
            DropTable("dbo.FimPayCheque");
            DropTable("dbo.FimReceive");
            DropTable("dbo.IcmDeliveryNotePenalty");
            DropTable("dbo.IcmPurchaseOrderPenalty");
            DropTable("dbo.FimEmployeeTax");
            DropTable("dbo.FimMasFund");
            DropTable("dbo.IcmMasPurchaseRegularMapping");
            DropTable("dbo.IcmMasContactBank");
            DropTable("dbo.IcmMasContactPartner");
            DropTable("dbo.IcmReceive");
            DropTable("dbo.IcmWarehousePermit");
            DropTable("dbo.IcmReceiveDtl");
            DropTable("dbo.IcmAsset");
            DropTable("dbo.IcmAssetWarranty");
            DropTable("dbo.IcmOfficeSuppliesLot");
            DropTable("dbo.IcmRequestParcel");
            DropTable("dbo.IcmRequestParcelDtl");
            DropTable("dbo.IcmDispense");
            DropTable("dbo.IcmDispenseHistory");
            DropTable("dbo.IcmMovement");
            DropTable("dbo.IcmMovementDtl");
            DropTable("dbo.IcmCommittee");
            DropTable("dbo.IcmFile");
            DropTable("dbo.IcmMovementHistory");
            DropTable("dbo.IcmDeliveryNoteItemExtra");
            DropTable("dbo.IcmPurchaseOrderItem");
            DropTable("dbo.SysUserLoginMonitor");
            DropTable("dbo.SysUserLoginLogout");
            DropTable("dbo.SysOTP");
            DropTable("dbo.SysUser");
            DropTable("dbo.SysMessage");
            DropTable("dbo.Message");
            DropTable("dbo.MessageWarning");
            DropTable("dbo.MessageSend");
            DropTable("dbo.MessageReply");
            DropTable("dbo.SysMenuItemList");
            DropTable("dbo.SysRole");
            DropTable("dbo.SysUserRole");
            DropTable("dbo.SysPermission");
            DropTable("dbo.HrmPsCommand");
            DropTable("dbo.HrmPsCommandType");
            DropTable("dbo.HrmPsCommandGroup");
            DropTable("dbo.HrmDcPenalty");
            DropTable("dbo.HrmPsCommandDtls");
            DropTable("dbo.HrmMpClass");
            DropTable("dbo.HrmMpPositionType");
            DropTable("dbo.HrmPsEduHistory");
            DropTable("dbo.MasEduDegree");
            DropTable("dbo.MasEduQualification");
            DropTable("dbo.HrmTmpEmployeeEducation");
            DropTable("dbo.MasEduInstitute");
            DropTable("dbo.MasEduMajor");
            DropTable("dbo.HrmTmpEmployee");
            DropTable("dbo.MasBloodGroup");
            DropTable("dbo.HrmRcEntryType");
            DropTable("dbo.HrmEsMoveRequest");
            DropTable("dbo.MasCurrency");
            DropTable("dbo.HrmPsEmpContact");
            DropTable("dbo.MasFamilyhood");
            DropTable("dbo.HrmMpScope");
            DropTable("dbo.HrmMpDuty");
            DropTable("dbo.HrmEsQuitRequest");
            DropTable("dbo.HrmPsEmployeeStatus");
            DropTable("dbo.HrmPsEmployeeType");
            DropTable("dbo.HrmMpPosition");
            DropTable("dbo.HrmPsEmpSkill");
            DropTable("dbo.MasSkillType");
            DropTable("dbo.HrmMpExecPosition");
            DropTable("dbo.SysExecPosGroup");
            DropTable("dbo.HrmMpFieldPosition");
            DropTable("dbo.HrmMpFieldGroup");
            DropTable("dbo.HrmMasClassSpecification");
            DropTable("dbo.HrmMpFieldDuty");
            DropTable("dbo.HrmMpFieldDutyDtls");
            DropTable("dbo.HrmMpFieldSpecificationDtls");
            DropTable("dbo.HrmMpFieldSpecification");
            DropTable("dbo.HrmPsEmpEducation");
            DropTable("dbo.HrmPsEmpEnglish");
            DropTable("dbo.HrmPsEmpGoodness");
            DropTable("dbo.HrmPsEmpIncreases");
            DropTable("dbo.HrmPsEmpPositionHistory");
            DropTable("dbo.HrmPsEmpNameHistory");
            DropTable("dbo.HrmPsEmpSalaryHistory");
            DropTable("dbo.HrmPsEmpMovment");
            DropTable("dbo.HrmPsEmpSpouse");
            DropTable("dbo.HrmPsEmpChildren");
            DropTable("dbo.HrmChgSpouse");
            DropTable("dbo.HrmChgRequest");
            DropTable("dbo.ChgTypes");
            DropTable("dbo.HrmPsEmpParent");
            DropTable("dbo.HrmRcInquireSubject");
            DropTable("dbo.HrmMpJobSiteArea");
            DropTable("dbo.HrmMpJobSiteCommand");
            DropTable("dbo.HrmMpJobSiteCommandDtls");
            DropTable("dbo.HrmMpJobSiteType");
            DropTable("dbo.HrmMpJobSpecification");
            DropTable("dbo.HrmPsEmpLegatee");
            DropTable("dbo.HrmMpArea");
            DropTable("dbo.MasCountryZone");
            DropTable("dbo.MasRecordStatus");
            DropTable("dbo.MasRegion");
            DropTable("dbo.MasSpecialSkillType");
            DropTable("dbo.HrmPsNonWorkingDay");
            DropTable("dbo.HrmPsNwdJobSite");
            DropTable("dbo.HrmMpPositionDuty");
            DropTable("dbo.HrmMpPositionDutyDtls");
            DropTable("dbo.HrmPrExtraType");
            DropTable("dbo.HrmMpPositionStatus");
            DropTable("dbo.HrmRcCatalog");
            DropTable("dbo.HrmRcCatalogStatus");
            DropTable("dbo.HrmPsRetirement");
            DropTable("dbo.HrmPsRetirementDtls");
            DropTable("dbo.HrmPsRoyalItemControl");
            DropTable("dbo.HrmPsRoyalItem");
            DropTable("dbo.HrmPsRoyalItemType");
            DropTable("dbo.HrmPsRoyalItemHistory");
            DropTable("dbo.HrmPsRoyalItemRequest");
            DropTable("dbo.HrmPsRoyalItemRepay");
            DropTable("dbo.HrmPsRoyalItemRepayDtls");
            DropTable("dbo.HrmPrSalaryGroup");
            DropTable("dbo.HrmScUser");
            DropTable("dbo.HrmPsEmpSpecialExpert");
            DropTable("dbo.HrmPsEmpSpecialSkill");
            DropTable("dbo.HrmPsTimeAttendant");
            DropTable("dbo.HrmTrainingRequest");
            DropTable("dbo.HrmDcStatus");
            DropTable("dbo.HrmTrainingTypeCategory");
            DropTable("dbo.HrmTrainingCourse");
            DropTable("dbo.HrmTrainingCurriculum");
            DropTable("dbo.HrmTrainingType");
            DropTable("dbo.HrmScholarshipFund");
            DropTable("dbo.HrmScholarshipType");
            DropTable("dbo.HrmTrainingInstitute");
            DropTable("dbo.HrmTrainingGroup");
            DropTable("dbo.HrmTrainingCourseTrainee");
            DropTable("dbo.HrmTrainingCourseQuota");
            DropTable("dbo.HrmTrainingCourseTrainer");
            DropTable("dbo.HrmTrainer");
            DropTable("dbo.HrmTrainingSubject");
            DropTable("dbo.HrmTrainingSubjectDtls");
            DropTable("dbo.HrmScholarship");
            DropTable("dbo.HrmScholarshipGroup");
            DropTable("dbo.HrmScholarshipGroupDtls");
            DropTable("dbo.HrmScholarshipRequest");
            DropTable("dbo.HrmAprAppraisal");
            DropTable("dbo.HrmAppraisalStdScore");
            DropTable("dbo.HrmEsResponse");
            DropTable("dbo.HrmEsMail");
            DropTable("dbo.bgm_request");
            DropTable("dbo.HrmPsAbsence");
            DropTable("dbo.HrmPsAbsenceType");
            DropTable("dbo.HrmPsAbsenceRule");
            DropTable("dbo.HrmPsAbsenceTypeGroup");
            DropTable("dbo.HrmActivity");
            DropTable("dbo.HrmActivityType");
            DropTable("dbo.HrmActivityRequest");
        }
        
        public override void Down()
        {
            CreateTable(
                "dbo.HrmActivityRequest",
                c => new
                    {
                        ActRequestId = c.Int(nullable: false, identity: true),
                        ActId = c.Int(nullable: false),
                        EmpId = c.Int(nullable: false),
                        Granted = c.Decimal(precision: 18, scale: 2),
                        ActRequestStatus = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ActRequestId);
            
            CreateTable(
                "dbo.HrmActivityType",
                c => new
                    {
                        ActTypeId = c.Int(nullable: false, identity: true),
                        ActTypeDescr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        Remark = c.String(),
                    })
                .PrimaryKey(t => t.ActTypeId);
            
            CreateTable(
                "dbo.HrmActivity",
                c => new
                    {
                        ActId = c.Int(nullable: false, identity: true),
                        BgmProjOperId = c.Int(),
                        ActDescr = c.String(),
                        ActTypeId = c.Int(nullable: false),
                        JobSiteId = c.Int(),
                        CityId = c.Int(),
                        LocationText = c.String(),
                        ActLimit = c.Decimal(precision: 18, scale: 2),
                        DateSignStart = c.DateTime(),
                        DateSignEnd = c.DateTime(),
                        TimeSignEnd = c.Time(),
                        DateActivityStart = c.DateTime(),
                        DateActivityEnd = c.DateTime(),
                        DateAppStart = c.DateTime(),
                        DateAppEnd = c.DateTime(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.String(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.String(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ActId);
            
            CreateTable(
                "dbo.HrmPsAbsenceTypeGroup",
                c => new
                    {
                        AbsenceTypeGroupId = c.Int(nullable: false, identity: true),
                        AbsenceTypeGroupName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AbsenceTypeGroupId);
            
            CreateTable(
                "dbo.HrmPsAbsenceRule",
                c => new
                    {
                        RuleId = c.Int(nullable: false, identity: true),
                        EmpTypeId = c.Int(nullable: false),
                        AbsenceTypeId = c.Int(nullable: false),
                        QuotaDay = c.Decimal(precision: 18, scale: 2),
                        QuotaSalary = c.Decimal(precision: 18, scale: 2),
                        QuotaCount = c.Decimal(precision: 18, scale: 2),
                        QuotaDayCount = c.Decimal(precision: 18, scale: 2),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RuleId);
            
            CreateTable(
                "dbo.HrmPsAbsenceType",
                c => new
                    {
                        AbsenceTypeId = c.Int(nullable: false, identity: true),
                        AbsenceTypeName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AbsenceTypeId);
            
            CreateTable(
                "dbo.HrmPsAbsence",
                c => new
                    {
                        AbsenceId = c.Int(nullable: false, identity: true),
                        AbsenceTypeId = c.Int(),
                        BgYear = c.Int(),
                        EmpId = c.Int(),
                        StartDate = c.DateTime(),
                        StartTime = c.String(),
                        EndDate = c.DateTime(),
                        EndTime = c.String(),
                        DayCount = c.Decimal(precision: 18, scale: 2),
                        ContactAddress = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        Description = c.String(),
                    })
                .PrimaryKey(t => t.AbsenceId);
            
            CreateTable(
                "dbo.bgm_request",
                c => new
                    {
                        bgm_req_seq = c.Int(nullable: false, identity: true),
                        bgm_req_code = c.String(storeType: "ntext"),
                        bgm_req_name = c.String(storeType: "ntext"),
                        bgm_req_descr = c.String(storeType: "ntext"),
                        bgm_req_manager = c.Int(),
                        bgm_req_scope = c.Int(),
                        bgm_req_date = c.DateTime(storeType: "datetime2"),
                        bgm_req_reason = c.String(storeType: "ntext"),
                        bgm_req_object = c.String(storeType: "ntext"),
                        bgm_req_target = c.String(storeType: "ntext"),
                        bgm_req_plan = c.String(storeType: "ntext"),
                        bgm_req_remark = c.String(storeType: "ntext"),
                        bgm_strat_list_seq = c.Int(),
                        prj_type_seq = c.Int(),
                        job_site_seq = c.Int(),
                        job_site_seq_main = c.Int(),
                        bgm_year = c.Int(),
                        date_start = c.DateTime(storeType: "datetime2"),
                        date_end = c.DateTime(storeType: "datetime2"),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_req_seq);
            
            CreateTable(
                "dbo.HrmEsMail",
                c => new
                    {
                        MailId = c.Int(nullable: false, identity: true),
                        MailTypeId = c.Int(),
                        SenderId = c.Int(),
                        ReceiverId = c.Int(),
                        ReqId = c.Int(),
                        Descr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MailId);
            
            CreateTable(
                "dbo.HrmEsResponse",
                c => new
                    {
                        RespId = c.Int(nullable: false, identity: true),
                        MailId = c.Int(),
                        RespStatus = c.String(),
                        Descr = c.String(),
                        RespNextId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RespId);
            
            CreateTable(
                "dbo.HrmAppraisalStdScore",
                c => new
                    {
                        StdScoreId = c.Int(nullable: false, identity: true),
                        StdScoreName = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.StdScoreId);
            
            CreateTable(
                "dbo.HrmAprAppraisal",
                c => new
                    {
                        AprId = c.Int(nullable: false, identity: true),
                        AprYear = c.Int(),
                        AprPeriod = c.Int(),
                        AprName = c.String(),
                        EmpTypeId = c.Int(),
                        ActStartDate = c.DateTime(),
                        ActEndDate = c.DateTime(),
                        AprStartDate = c.DateTime(),
                        AprEndDate = c.DateTime(),
                        StdScoreId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AprId);
            
            CreateTable(
                "dbo.HrmScholarshipRequest",
                c => new
                    {
                        TranId = c.Int(nullable: false, identity: true),
                        TranDate = c.DateTime(nullable: false),
                        EmpId = c.Int(nullable: false),
                        ScholarId = c.Int(nullable: false),
                        EduInsId = c.Int(),
                        DateStart = c.DateTime(),
                        DateEnd = c.DateTime(),
                        Granted = c.Decimal(nullable: false, precision: 18, scale: 2),
                        EduMajorId = c.Int(),
                        EduResultPassed = c.Decimal(precision: 18, scale: 2),
                        EduResultGpa = c.Decimal(precision: 18, scale: 2),
                        GetSalary = c.Decimal(nullable: false, precision: 18, scale: 2),
                        ApDescr = c.String(),
                        ApFhId = c.Int(nullable: false),
                        ApCitizenId = c.Int(nullable: false),
                        ApCareer = c.String(),
                        ApCareerPosition = c.String(),
                        ApContactAddress = c.String(),
                        ApContactDistrictId = c.Int(nullable: false),
                        ApContactPostalCode = c.String(),
                        ApContactTel = c.String(),
                        ApDateSigned = c.DateTime(),
                        ApDateAssured = c.DateTime(),
                        AssureRefNo = c.String(),
                        EpcCompareResultNo = c.Decimal(precision: 18, scale: 2),
                        AmountRepay = c.Decimal(precision: 18, scale: 2),
                        AmountRepayReal = c.Decimal(precision: 18, scale: 2),
                        RepayMoney = c.Decimal(precision: 18, scale: 2),
                        ContractNo = c.String(),
                        Remarks = c.String(),
                        GetPositionCost = c.Decimal(precision: 18, scale: 2),
                        EduQualId = c.Int(nullable: false),
                        TeacherName = c.String(),
                        ResponseDate = c.DateTime(),
                        ResponseNo = c.String(),
                        TeacherTel = c.String(),
                        TeacherFax = c.String(),
                        DurationYear = c.Decimal(precision: 18, scale: 2),
                        DurationMonth = c.Decimal(precision: 18, scale: 2),
                        EntranceDescr = c.String(),
                        AmountRequest = c.Decimal(precision: 18, scale: 2),
                        AmountApprove = c.Decimal(precision: 18, scale: 2),
                        ResponseTypeId = c.Int(),
                        EduResultRemarks = c.String(),
                        DocNo = c.String(),
                        ScholarGroupId = c.Int(),
                        StatusCancel = c.String(),
                        StatusCancelRemarks = c.String(),
                        StatusReturn = c.String(),
                        StatusReturnRemarks = c.String(),
                        StatusTransfer = c.String(),
                        StatusTransferRemarks = c.String(),
                        StatusRepay = c.String(),
                        StatusRepayRemarks = c.String(),
                        StatusComplete = c.String(),
                        StatusCompleteRemarks = c.String(),
                        EduProvDescr = c.String(),
                        ProjectDescr = c.String(),
                        FacultyDescr = c.String(),
                        DepartmentDescr = c.String(),
                        EmpText = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TranId);
            
            CreateTable(
                "dbo.HrmScholarshipGroupDtls",
                c => new
                    {
                        ScholarGroupId = c.Int(nullable: false, identity: true),
                        SeqNo = c.Decimal(nullable: false, precision: 18, scale: 2),
                        EduMajorId = c.Int(nullable: false),
                        ScholarId = c.Int(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ScholarGroupId);
            
            CreateTable(
                "dbo.HrmScholarshipGroup",
                c => new
                    {
                        ScholarGroupId = c.Int(nullable: false, identity: true),
                        ScholarGroupDescr = c.String(),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        ScholarId = c.Int(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ScholarGroupId);
            
            CreateTable(
                "dbo.HrmScholarship",
                c => new
                    {
                        ScholarId = c.Int(nullable: false, identity: true),
                        ScholarDescr = c.String(),
                        ScholarTypeId = c.Int(nullable: false),
                        ScholarFundId = c.Int(nullable: false),
                        ScholarFundSeq2 = c.Int(),
                        EduDegreeId = c.Int(nullable: false),
                        CountryId = c.Int(nullable: false),
                        Amount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Closed = c.Decimal(nullable: false, precision: 18, scale: 2),
                        DateSignStart = c.DateTime(),
                        DateSignEnd = c.DateTime(),
                        TimeStart = c.Time(),
                        TimeEnd = c.Time(),
                        EduYearEnd = c.String(),
                        EduYearStart = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ScholarId);
            
            CreateTable(
                "dbo.HrmTrainingSubjectDtls",
                c => new
                    {
                        TrainingSubjectDtlsId = c.Int(nullable: false, identity: true),
                        TrainingSubjectId = c.Int(nullable: false),
                        TopicDescr = c.String(),
                        Detail = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainingSubjectDtlsId);
            
            CreateTable(
                "dbo.HrmTrainingSubject",
                c => new
                    {
                        TrainingSubjectId = c.Int(nullable: false, identity: true),
                        TrainingSubjectDescr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainingSubjectId);
            
            CreateTable(
                "dbo.HrmTrainer",
                c => new
                    {
                        TrainerId = c.Int(nullable: false, identity: true),
                        NamePrefixId = c.Int(),
                        FirstNameLocal = c.String(),
                        LastNameLocal = c.String(),
                        EmpId = c.Int(),
                        Active = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Address = c.String(),
                        PostalCode = c.String(),
                        Tel = c.String(),
                        Email = c.String(),
                        Website = c.String(),
                        Citizen = c.String(),
                        DistrictId = c.Int(),
                        RecordStatus = c.String(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainerId);
            
            CreateTable(
                "dbo.HrmTrainingCourseTrainer",
                c => new
                    {
                        CourseTrainerId = c.Int(nullable: false, identity: true),
                        TrainId = c.Int(nullable: false),
                        TrainerId = c.Int(),
                        TrainingSubjectId = c.Int(),
                        TrainingSubjectDtlsId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CourseTrainerId);
            
            CreateTable(
                "dbo.HrmTrainingCourseQuota",
                c => new
                    {
                        CourseQuotaId = c.Int(nullable: false, identity: true),
                        TrainId = c.Int(nullable: false),
                        JobSiteId = c.Int(nullable: false),
                        Quota = c.Decimal(nullable: false, precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.String(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.String(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CourseQuotaId);
            
            CreateTable(
                "dbo.HrmTrainingCourseTrainee",
                c => new
                    {
                        TraineeId = c.Int(nullable: false, identity: true),
                        TrainId = c.Int(),
                        EmpId = c.Int(),
                        Score = c.Decimal(precision: 18, scale: 2),
                        ScoredBy = c.String(),
                        ScoredWhen = c.DateTime(),
                        ResultMemo = c.String(),
                        Granted = c.Decimal(precision: 18, scale: 2),
                        TrainHour = c.Decimal(precision: 18, scale: 2),
                        TraineeText = c.String(),
                        OrgText = c.String(),
                        JobSiteId = c.Int(),
                        WorkingText = c.String(),
                        PositionText = c.String(),
                        ClassText = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.String(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.String(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TraineeId);
            
            CreateTable(
                "dbo.HrmTrainingGroup",
                c => new
                    {
                        TrainingGroupId = c.Int(nullable: false, identity: true),
                        TrainingGroupDescr = c.String(),
                        _internal = c.Decimal(name: "internal", precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdateWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainingGroupId);
            
            CreateTable(
                "dbo.HrmTrainingInstitute",
                c => new
                    {
                        TrainingInsId = c.Int(nullable: false, identity: true),
                        TrainingInsDescr = c.String(),
                        TrainingInsResponsible = c.String(),
                        CountryId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainingInsId);
            
            CreateTable(
                "dbo.HrmScholarshipType",
                c => new
                    {
                        ScholarTypeId = c.Int(nullable: false, identity: true),
                        ScholarTypeDescr = c.String(),
                        ScholarLocal = c.Decimal(precision: 18, scale: 2),
                        EduTimeType = c.Decimal(precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ScholarTypeId);
            
            CreateTable(
                "dbo.HrmScholarshipFund",
                c => new
                    {
                        ScholarFundId = c.Int(nullable: false, identity: true),
                        ScholarFundDescr = c.String(),
                        ScholarTypeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ScholarFundId);
            
            CreateTable(
                "dbo.HrmTrainingType",
                c => new
                    {
                        TrainingTypeId = c.Int(nullable: false, identity: true),
                        TrainingTypeDescr = c.String(),
                        TrainingCatId = c.Int(nullable: false),
                        _internal = c.Decimal(name: "internal", precision: 18, scale: 2),
                        Local = c.Decimal(precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainingTypeId);
            
            CreateTable(
                "dbo.HrmTrainingCurriculum",
                c => new
                    {
                        TrainingCurId = c.Int(nullable: false, identity: true),
                        TrainingCurDescr = c.String(),
                        Details = c.String(),
                        ComparableGroup = c.String(),
                        TrainingTypeId = c.Int(nullable: false),
                        DefaultTotalHours = c.Decimal(precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.String(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.String(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainingCurId);
            
            CreateTable(
                "dbo.HrmTrainingCourse",
                c => new
                    {
                        TrainId = c.Long(nullable: false, identity: true),
                        RefNo = c.String(),
                        TrainingCourseDescr = c.String(),
                        TrainingCurId = c.Int(),
                        DateSignStart = c.DateTime(),
                        DateSignEnd = c.DateTime(),
                        TimeSignEnd = c.Time(),
                        DateTrainingStart = c.DateTime(),
                        DateTrainingEnd = c.DateTime(),
                        ScheduleText = c.String(),
                        MaxTraineeCount = c.Decimal(precision: 18, scale: 2),
                        UnitPrice = c.Decimal(precision: 18, scale: 2),
                        TotalScore = c.Decimal(precision: 18, scale: 2),
                        ScoreVeryGood = c.Decimal(precision: 18, scale: 2),
                        ScoreGood = c.Decimal(precision: 18, scale: 2),
                        ScoreAcceptable = c.Decimal(precision: 18, scale: 2),
                        ScoreType = c.Decimal(nullable: false, precision: 18, scale: 2),
                        EmpSecId = c.Int(),
                        Closed = c.Decimal(precision: 18, scale: 2),
                        ScholarFundId = c.Int(),
                        EpcId = c.Int(),
                        TrainingInsId = c.Int(),
                        Remarks = c.String(),
                        TotalCost = c.Decimal(precision: 18, scale: 2),
                        CountryId = c.Int(),
                        TrainingGroupId = c.Int(),
                        TotalHours = c.Decimal(precision: 18, scale: 2),
                        OrgText = c.String(),
                        BgSourceId = c.Int(),
                        TotalPrice = c.Decimal(precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.String(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.String(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainId);
            
            CreateTable(
                "dbo.HrmTrainingTypeCategory",
                c => new
                    {
                        TrainingCatId = c.Int(nullable: false, identity: true),
                        TrainingCatDescr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdateWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TrainingCatId);
            
            CreateTable(
                "dbo.HrmDcStatus",
                c => new
                    {
                        StatId = c.Int(nullable: false, identity: true),
                        StatName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.StatId);
            
            CreateTable(
                "dbo.HrmTrainingRequest",
                c => new
                    {
                        RequestId = c.Int(nullable: false, identity: true),
                        TrainingCurDescr = c.String(),
                        DateTraining = c.DateTime(),
                        TrainingPlace = c.String(),
                        TrainingCreate = c.String(),
                        Remarks = c.String(),
                        EmpId = c.Int(nullable: false),
                        RequestedWhen = c.DateTime(),
                        StatusId = c.Int(nullable: false),
                        UpdatedBy = c.String(),
                        UpdatedWhen = c.DateTime(),
                        RecordStatus = c.String(),
                    })
                .PrimaryKey(t => t.RequestId);
            
            CreateTable(
                "dbo.HrmPsTimeAttendant",
                c => new
                    {
                        WorkingId = c.Int(nullable: false, identity: true),
                        WorkingDate = c.DateTime(),
                        EmpId = c.Int(),
                        WorkingStatus = c.String(),
                        WorkingStart = c.Time(),
                        WorkingEnd = c.Time(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.WorkingId);
            
            CreateTable(
                "dbo.HrmPsEmpSpecialSkill",
                c => new
                    {
                        SkillId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        SkillTypeId = c.Int(),
                        SkillDescr = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SkillId);
            
            CreateTable(
                "dbo.HrmPsEmpSpecialExpert",
                c => new
                    {
                        EmpExpId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        ExpDescr = c.String(),
                        Remarks = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpExpId);
            
            CreateTable(
                "dbo.HrmScUser",
                c => new
                    {
                        ScUserId = c.Int(nullable: false, identity: true),
                        ScEmpId = c.Int(),
                        JobSiteId = c.Int(),
                        ScUserDescr = c.String(),
                        ScUserPassword = c.String(),
                        ScInitialPassword = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ScUserId);
            
            CreateTable(
                "dbo.HrmPrSalaryGroup",
                c => new
                    {
                        SalGrpId = c.Int(nullable: false, identity: true),
                        SalGrpDescr = c.String(),
                        EmpTypeId = c.Int(),
                        PosTypeId = c.Int(),
                        ClassId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SalGrpId);
            
            CreateTable(
                "dbo.HrmPsRoyalItemRepayDtls",
                c => new
                    {
                        RepayDtlsId = c.Int(nullable: false, identity: true),
                        RepayId = c.Int(),
                        RoyalItemId = c.Int(),
                        GenderId = c.Int(),
                        Amount = c.Double(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RepayDtlsId);
            
            CreateTable(
                "dbo.HrmPsRoyalItemRepay",
                c => new
                    {
                        RepayId = c.Int(nullable: false, identity: true),
                        RefNo = c.String(),
                        RepayDescr = c.String(),
                        StartDate = c.DateTime(),
                        EndDate = c.DateTime(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RepayId);
            
            CreateTable(
                "dbo.HrmPsRoyalItemRequest",
                c => new
                    {
                        ReqId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        ReqYear = c.Decimal(precision: 18, scale: 2),
                        RoyalItemId = c.Int(),
                        CurrRoyalItemId = c.Int(),
                        PosId = c.Int(),
                        ClassId = c.Int(),
                        JobSiteId = c.Int(),
                        Salary = c.Double(),
                        Need = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReqId);
            
            CreateTable(
                "dbo.HrmPsRoyalItemHistory",
                c => new
                    {
                        RoyalItemHisId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        RoyalItemReqId = c.Int(),
                        RoyalItemId = c.Int(),
                        ReceivedDate = c.DateTime(),
                        PosRef = c.String(),
                        PosName = c.String(),
                        ClassName = c.String(),
                        Salary = c.Double(),
                        JobSiteName = c.String(),
                        GazetteNo1 = c.String(),
                        GazetteNo2 = c.String(),
                        GazetteNo3 = c.String(),
                        GazetteNo4 = c.String(),
                        GazetteNo5 = c.String(),
                        GazetteDate = c.DateTime(),
                        GetDate = c.DateTime(),
                        ReturnFlag = c.String(),
                        ReturnDate = c.DateTime(),
                        ReturnAmount = c.Double(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RoyalItemHisId);
            
            CreateTable(
                "dbo.HrmPsRoyalItemType",
                c => new
                    {
                        RoyalItemTypeId = c.Int(nullable: false, identity: true),
                        RoyalItemTypeCode = c.String(),
                        RoyalItemTypeName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RoyalItemTypeId);
            
            CreateTable(
                "dbo.HrmPsRoyalItem",
                c => new
                    {
                        RoyalItemId = c.Int(nullable: false, identity: true),
                        RoyalItemTypeId = c.Int(),
                        RoyalItemCode = c.String(),
                        RoyalItemName = c.String(),
                        RoyalItemNameShort = c.String(),
                        RoyalItemLevel = c.String(),
                        RoyalItemGroup = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RoyalItemId);
            
            CreateTable(
                "dbo.HrmPsRoyalItemControl",
                c => new
                    {
                        CtrlId = c.Long(nullable: false, identity: true),
                        EmpId = c.Int(),
                        ReturnDate = c.DateTime(),
                        Amount = c.Double(),
                        RoyalItemId = c.Int(),
                        GetDate = c.DateTime(),
                        ReturnFlag = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CtrlId);
            
            CreateTable(
                "dbo.HrmPsRetirementDtls",
                c => new
                    {
                        RetireDtlsId = c.Int(nullable: false, identity: true),
                        RetireId = c.Int(),
                        EmpId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RetireDtlsId);
            
            CreateTable(
                "dbo.HrmPsRetirement",
                c => new
                    {
                        RetireId = c.Int(nullable: false, identity: true),
                        EmpTypeId = c.Int(),
                        RetireYear = c.Int(nullable: false),
                        StartDate = c.DateTime(),
                        JobSiteId = c.Int(),
                        RefNo = c.String(),
                        RetireTitle = c.String(),
                        RetireDescr = c.String(),
                        ApprovedDate = c.DateTime(),
                        ApprovedName = c.String(),
                        ApprovedPosition = c.String(),
                        RetireStatus = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RetireId);
            
            CreateTable(
                "dbo.HrmRcCatalogStatus",
                c => new
                    {
                        CatStatusId = c.Int(nullable: false, identity: true),
                        CatStatusName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CatStatusId);
            
            CreateTable(
                "dbo.HrmRcCatalog",
                c => new
                    {
                        CatId = c.Int(nullable: false, identity: true),
                        BgYear = c.Int(),
                        CatPeriod = c.String(),
                        CatName = c.String(),
                        EmpTypeId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CatId);
            
            CreateTable(
                "dbo.HrmMpPositionStatus",
                c => new
                    {
                        StatusId = c.Int(nullable: false, identity: true),
                        StatusName = c.String(),
                        Empty = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.StatusId);
            
            CreateTable(
                "dbo.HrmPrExtraType",
                c => new
                    {
                        ExtId = c.Int(nullable: false, identity: true),
                        EmpTypeId = c.Int(),
                        ExtCode = c.String(),
                        ExtName = c.String(),
                        ExtNameShort = c.String(),
                        CmdTypeId = c.Int(),
                        ExtFlag = c.String(),
                        ExtTax = c.String(),
                        ExtMonthly = c.String(),
                        ExtAmount = c.Double(),
                        ExtOthCode = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        EditSystem = c.String(),
                        ContactId = c.Int(),
                    })
                .PrimaryKey(t => t.ExtId);
            
            CreateTable(
                "dbo.HrmMpPositionDutyDtls",
                c => new
                    {
                        PosDutyDtlsId = c.Int(nullable: false, identity: true),
                        PosDutyId = c.Int(),
                        SeqNo = c.String(),
                        Descr = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PosDutyDtlsId);
            
            CreateTable(
                "dbo.HrmMpPositionDuty",
                c => new
                    {
                        PosDutyId = c.Int(nullable: false, identity: true),
                        PosId = c.Int(),
                        DutyId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PosDutyId);
            
            CreateTable(
                "dbo.HrmPsNwdJobSite",
                c => new
                    {
                        NwdJobSiteId = c.Int(nullable: false, identity: true),
                        NonWorkingId = c.Int(),
                        JobSiteId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.NwdJobSiteId);
            
            CreateTable(
                "dbo.HrmPsNonWorkingDay",
                c => new
                    {
                        NonWorkingId = c.Int(nullable: false, identity: true),
                        BgYear = c.Int(),
                        NonWorkingDate = c.DateTime(nullable: false),
                        NonWorkingName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.NonWorkingId);
            
            CreateTable(
                "dbo.MasSpecialSkillType",
                c => new
                    {
                        SkillTypeId = c.Int(nullable: false, identity: true),
                        SkillTypeName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SkillTypeId);
            
            CreateTable(
                "dbo.MasRegion",
                c => new
                    {
                        RegionId = c.Int(nullable: false, identity: true),
                        RegionName = c.String(),
                        RegionNameEng = c.String(),
                        CountryId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RegionId);
            
            CreateTable(
                "dbo.MasRecordStatus",
                c => new
                    {
                        RecordId = c.Int(nullable: false, identity: true),
                        RecordStatus = c.String(),
                        RecordStatusName = c.String(),
                        CmdStatusName = c.String(),
                    })
                .PrimaryKey(t => t.RecordId);
            
            CreateTable(
                "dbo.MasCountryZone",
                c => new
                    {
                        ZoneId = c.Int(nullable: false, identity: true),
                        ZoneName = c.String(),
                        ZoneNameEng = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ZoneId);
            
            CreateTable(
                "dbo.HrmMpArea",
                c => new
                    {
                        AreaId = c.Int(nullable: false, identity: true),
                        AreaName = c.String(),
                        AreaNameEng = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AreaId);
            
            CreateTable(
                "dbo.HrmPsEmpLegatee",
                c => new
                    {
                        EmpLegateeId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        LegateeNo = c.Int(nullable: false),
                        NamePrefixId = c.Int(),
                        LegateeName = c.String(),
                        LegateeLastName = c.String(),
                        FamId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpLegateeId);
            
            CreateTable(
                "dbo.HrmMpJobSpecification",
                c => new
                    {
                        JobSpecId = c.Int(nullable: false, identity: true),
                        JobSpecName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.JobSpecId);
            
            CreateTable(
                "dbo.HrmMpJobSiteType",
                c => new
                    {
                        JobSiteTypeId = c.Int(nullable: false, identity: true),
                        JobSiteTypeName = c.String(),
                        CurrJobSiteId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        current_HrmMpJobSites_JobSiteId = c.Int(),
                    })
                .PrimaryKey(t => t.JobSiteTypeId);
            
            CreateTable(
                "dbo.HrmMpJobSiteCommandDtls",
                c => new
                    {
                        JobSiteCmdDtlsId = c.Int(nullable: false, identity: true),
                        JobSiteCmdId = c.Int(nullable: false),
                        CmdDtlsFlag = c.String(),
                        JobSiteId = c.Int(),
                        FromRefNo = c.String(),
                        ToRefNo = c.String(),
                        FromJobSiteName = c.String(),
                        ToJobSiteName = c.String(),
                        FromUpperId = c.Int(),
                        ToUpperId = c.Int(),
                        FromUpperName = c.String(),
                        ToUpperName = c.String(),
                        DateStart = c.DateTime(),
                        OldStartDate = c.DateTime(),
                        NewCmdDate = c.DateTime(),
                        OldCmdDate = c.DateTime(),
                        NewCmdRefNo = c.String(),
                        OldCmdRefNo = c.String(),
                        FromJobSiteLevelId = c.Int(),
                        ToJobSiteLevelId = c.Int(),
                        FromJobDescription = c.String(),
                        ToJobDescription = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        Cancel = c.Int(),
                    })
                .PrimaryKey(t => t.JobSiteCmdDtlsId);
            
            CreateTable(
                "dbo.HrmMpJobSiteCommand",
                c => new
                    {
                        JobSiteCmdId = c.Int(nullable: false, identity: true),
                        CmdFlag = c.String(),
                        JobSiteTypeId = c.Int(),
                        CmdDraftNo = c.String(),
                        CmdRefNo = c.String(),
                        CmdDescr = c.String(),
                        CmdStatus = c.String(),
                        ApprovedBy = c.Int(),
                        ApprovedName = c.String(),
                        ApprovedDate = c.DateTime(),
                        ApprovedPositions = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.JobSiteCmdId);
            
            CreateTable(
                "dbo.HrmMpJobSiteArea",
                c => new
                    {
                        JobSiteAreaId = c.Int(nullable: false, identity: true),
                        JobSiteId = c.Int(),
                        AreaName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.JobSiteAreaId);
            
            CreateTable(
                "dbo.HrmRcInquireSubject",
                c => new
                    {
                        SubjId = c.Int(nullable: false, identity: true),
                        SubjNo = c.String(),
                        Descr = c.String(),
                        Max = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SubjId);
            
            CreateTable(
                "dbo.HrmPsEmpParent",
                c => new
                    {
                        ParentId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        NamePrefixId = c.Int(),
                        ParentName = c.String(),
                        ParentLastName = c.String(),
                        BirthDate = c.DateTime(),
                        ParentType = c.String(),
                        CareStatus = c.String(),
                        ParentStatus = c.String(),
                        Citizen = c.String(),
                        TaxPayer = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ParentId);
            
            CreateTable(
                "dbo.ChgTypes",
                c => new
                    {
                        ChgTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ChgTypeId);
            
            CreateTable(
                "dbo.HrmChgRequest",
                c => new
                    {
                        ChgReqId = c.Int(nullable: false, identity: true),
                        ChgTypeId = c.Int(),
                        ChgRefNo = c.String(),
                        ChgDate = c.DateTime(),
                        EmpId = c.Int(),
                        ChgStatus = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ChgReqId);
            
            CreateTable(
                "dbo.HrmChgSpouse",
                c => new
                    {
                        ChgSpouseId = c.Int(nullable: false, identity: true),
                        ChgReqId = c.Int(),
                        SpouseId = c.Int(),
                        NamePrefixId = c.Int(),
                        SpouseName = c.String(),
                        SpouseLastName = c.String(),
                        EarningStatus = c.String(),
                        SpouseStatus = c.String(),
                        Citizen = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ChgSpouseId);
            
            CreateTable(
                "dbo.HrmPsEmpChildren",
                c => new
                    {
                        ChildId = c.Int(nullable: false, identity: true),
                        ChildNo = c.Int(nullable: false),
                        EmpId = c.Int(nullable: false),
                        GenderId = c.Int(),
                        NamePrefixId = c.Int(),
                        ChildName = c.String(),
                        ChildLastName = c.String(),
                        BirthDate = c.DateTime(),
                        EduDegreeId = c.Int(),
                        EduInsId = c.Int(),
                        FeeDateEnd = c.DateTime(),
                        FeeEdu = c.String(),
                        ChildStatus = c.String(),
                        EduStatus = c.String(),
                        SpouseId = c.Int(),
                        ChildType = c.String(),
                        Citizen = c.String(),
                        DeathDate = c.DateTime(),
                        DeathRefNo = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        HrmPsEmployees_EmpId = c.Int(),
                    })
                .PrimaryKey(t => t.ChildId);
            
            CreateTable(
                "dbo.HrmPsEmpSpouse",
                c => new
                    {
                        SpouseId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        NamePrefixId = c.Int(),
                        SpouseName = c.String(),
                        SpouseLastName = c.String(),
                        EarningStatus = c.String(),
                        SpouseStatus = c.String(),
                        Citizen = c.String(),
                        TaxPayer = c.String(),
                        BirthDate = c.DateTime(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SpouseId);
            
            CreateTable(
                "dbo.HrmPsEmpMovment",
                c => new
                    {
                        MoveId = c.Int(nullable: false, identity: true),
                        EmpTypeId = c.Int(),
                        MoveCode = c.String(),
                        MoveName = c.String(),
                        MoveType = c.String(),
                        MoveSubType = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MoveId);
            
            CreateTable(
                "dbo.HrmPsEmpSalaryHistory",
                c => new
                    {
                        SalHisId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        StartDate = c.DateTime(),
                        EndDate = c.DateTime(),
                        CmdRefNo = c.String(),
                        CmdName = c.String(),
                        CmdDate = c.DateTime(),
                        PosRef = c.String(),
                        PosName = c.String(),
                        ClassId = c.Int(),
                        ClassName = c.String(),
                        JobSiteId = c.Int(),
                        JobSiteName = c.String(),
                        SalaryNew = c.Double(),
                        SalaryOld = c.Double(),
                        SalaryPercentUp = c.Double(),
                        SalaryUp = c.Double(),
                        SalaryMidpoint = c.Double(),
                        SalaryExtra = c.Double(),
                        TotalScore = c.Double(),
                        MoveId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SalHisId);
            
            CreateTable(
                "dbo.HrmPsEmpNameHistory",
                c => new
                    {
                        NameHisId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        ChangedRefNo = c.String(),
                        ChangedDate = c.DateTime(),
                        OldPrefixId = c.Int(),
                        OldName = c.String(),
                        OldLastName = c.String(),
                        NewPrefixId = c.Int(),
                        NewName = c.String(),
                        NewLastName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.NameHisId);
            
            CreateTable(
                "dbo.HrmPsEmpPositionHistory",
                c => new
                    {
                        PosHisId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        StartDate = c.DateTime(),
                        EndDate = c.DateTime(),
                        CmdDtlsId = c.Int(),
                        CmdRefNo = c.String(),
                        CmdDate = c.DateTime(),
                        CmdName = c.String(),
                        CmdPosRef = c.String(),
                        CmdPosName = c.String(),
                        CmdClassId = c.Int(),
                        CmdClassName = c.String(),
                        CmdJobSiteId = c.Int(),
                        CmdJobSiteName = c.String(),
                        CmdWorkingJobSiteName = c.String(),
                        CmdDepName = c.String(),
                        CmdMisName = c.String(),
                        CmdFieldId = c.Int(),
                        CmdFieldName = c.String(),
                        CmdExecId = c.Int(),
                        CmdExecName = c.String(),
                        CmdSalary = c.Double(),
                        CmdSalaryPosition = c.Double(),
                        Salary = c.Double(),
                        PosRef = c.String(),
                        PosName = c.String(),
                        ClassId = c.Int(),
                        ClassName = c.String(),
                        JobSiteId = c.Int(),
                        JobSiteName = c.String(),
                        MoveId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        CmdTypeId = c.Int(),
                        HisType = c.String(),
                        WorkingJobSiteName = c.String(),
                        DepartmentName = c.String(),
                        MinistryName = c.String(),
                        FieldName = c.String(),
                        ExecName = c.String(),
                    })
                .PrimaryKey(t => t.PosHisId);
            
            CreateTable(
                "dbo.HrmPsEmpIncreases",
                c => new
                    {
                        IncreaseId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        IncreaseName = c.String(),
                        IncreaseRefNo = c.String(),
                        StartDate = c.DateTime(),
                        EndDate = c.DateTime(),
                        CountDate = c.Double(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.IncreaseId);
            
            CreateTable(
                "dbo.HrmPsEmpGoodness",
                c => new
                    {
                        GoodNessId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        GoodNessDescr = c.String(),
                        GoodNessDate = c.DateTime(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.GoodNessId);
            
            CreateTable(
                "dbo.HrmPsEmpEnglish",
                c => new
                    {
                        EngId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        InsName = c.String(),
                        Remarks = c.String(),
                        DateStart = c.DateTime(),
                        DateEnd = c.DateTime(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        HrmPsEmployees_EmpId = c.Int(),
                    })
                .PrimaryKey(t => t.EngId);
            
            CreateTable(
                "dbo.HrmPsEmpEducation",
                c => new
                    {
                        EduId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        EduDegreeId = c.Int(),
                        EduQualId = c.Int(),
                        EduInsId = c.Int(),
                        EduMajorId = c.Int(),
                        StartDate = c.DateTime(),
                        EduStartYear = c.Int(),
                        EndDate = c.DateTime(),
                        EduEndYear = c.Int(),
                        FundTypeId = c.Int(),
                        Gpa = c.Decimal(precision: 18, scale: 2),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        HrmPsEmployees_EmpId = c.Int(),
                    })
                .PrimaryKey(t => t.EduId);
            
            CreateTable(
                "dbo.HrmMpFieldSpecification",
                c => new
                    {
                        FieldSpecId = c.Int(nullable: false, identity: true),
                        FieldPosId = c.Int(),
                        ClassId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FieldSpecId);
            
            CreateTable(
                "dbo.HrmMpFieldSpecificationDtls",
                c => new
                    {
                        FieldSpecDtlsId = c.Int(nullable: false, identity: true),
                        FieldSpecId = c.Int(),
                        PosTypeId = c.Int(),
                        ClassId = c.Int(),
                        Durations = c.Decimal(precision: 18, scale: 2),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FieldSpecDtlsId);
            
            CreateTable(
                "dbo.HrmMpFieldDutyDtls",
                c => new
                    {
                        FieldDutyDtlsId = c.Int(nullable: false, identity: true),
                        FieldDutyId = c.Int(nullable: false),
                        DutyId = c.Int(),
                        SeqNo = c.String(),
                        Descr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FieldDutyDtlsId);
            
            CreateTable(
                "dbo.HrmMpFieldDuty",
                c => new
                    {
                        FieldDutyId = c.Int(nullable: false, identity: true),
                        FieldPosId = c.Int(),
                        ClassId = c.Int(),
                        Descr = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FieldDutyId);
            
            CreateTable(
                "dbo.HrmMasClassSpecification",
                c => new
                    {
                        ClassSpecId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        NameEng = c.String(),
                        PosTypeId = c.Int(),
                        ClassMax = c.Int(),
                        ClassMin = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ClassSpecId);
            
            CreateTable(
                "dbo.HrmMpFieldGroup",
                c => new
                    {
                        FieldGroupId = c.Int(nullable: false, identity: true),
                        FieldGroupName = c.String(),
                        FieldGroupDescr = c.String(),
                        EmpTypeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FieldGroupId);
            
            CreateTable(
                "dbo.HrmMpFieldPosition",
                c => new
                    {
                        FieldPosId = c.Int(nullable: false, identity: true),
                        FieldPosCode = c.String(),
                        FieldPosName = c.String(),
                        FieldPosNameEng = c.String(),
                        FieldPosLine = c.String(),
                        FieldPosLineShort = c.String(),
                        FieldPosLineEng = c.String(),
                        EmpTypeId = c.Int(),
                        PosTypeId = c.Int(),
                        FieldGroupId = c.Int(),
                        ClassSpecId = c.Int(),
                        FieldPosSeqNew = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FieldPosId);
            
            CreateTable(
                "dbo.SysExecPosGroup",
                c => new
                    {
                        ExecPosGroupId = c.Int(nullable: false, identity: true),
                        ExecPosGroupName = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ExecPosGroupId);
            
            CreateTable(
                "dbo.HrmMpExecPosition",
                c => new
                    {
                        ExecPosId = c.Int(nullable: false, identity: true),
                        ExecPosCode = c.String(),
                        ExecPosName = c.String(),
                        ExecPosNameShort = c.String(),
                        ExecPosNameEng = c.String(),
                        ExecPosNameEngShort = c.String(),
                        ExecPosGroupId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ExecPosId);
            
            CreateTable(
                "dbo.MasSkillType",
                c => new
                    {
                        SkillTypeId = c.Int(nullable: false, identity: true),
                        SkillTypeName = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SkillTypeId);
            
            CreateTable(
                "dbo.HrmPsEmpSkill",
                c => new
                    {
                        SkillId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        SkillTypeId = c.Int(),
                        SkillDescr = c.String(),
                        Remarks = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SkillId);
            
            CreateTable(
                "dbo.HrmMpPosition",
                c => new
                    {
                        PosId = c.Int(nullable: false, identity: true),
                        PosRef = c.String(),
                        PosName = c.String(),
                        FieldPosId = c.Int(),
                        ExecPosId = c.Int(),
                        EmpTypeId = c.Int(),
                        DateDefined = c.DateTime(),
                        DateMoneySupport = c.DateTime(),
                        DateChanged = c.DateTime(),
                        ChangeRefNo = c.String(),
                        SalaryQuota = c.Double(),
                        LastSalaryQuota = c.Double(),
                        JobSiteId = c.Int(),
                        PosStatus = c.String(),
                        SalaryMin = c.Double(),
                        SalaryMax = c.Double(),
                        PosExecSalary = c.Double(),
                        PosUpperId = c.Int(),
                        PosWorkingUpperId = c.Int(),
                        JobDescription = c.String(),
                        SkillId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        SalaryGlow = c.Double(),
                        CurrencyId = c.Int(),
                    })
                .PrimaryKey(t => t.PosId);
            
            CreateTable(
                "dbo.HrmPsEmployeeType",
                c => new
                    {
                        EmpTypeId = c.Int(nullable: false, identity: true),
                        EmpTypeName = c.String(),
                        SalaryUpTime = c.Int(),
                        Retirements = c.Int(),
                        Royalitems = c.Int(),
                        YearTypeId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpTypeId);
            
            CreateTable(
                "dbo.HrmPsEmployeeStatus",
                c => new
                    {
                        EmpStatusId = c.Int(nullable: false, identity: true),
                        EmpStatusName = c.String(),
                        Active = c.String(),
                        EmpStatusCode = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpStatusId);
            
            CreateTable(
                "dbo.HrmEsQuitRequest",
                c => new
                    {
                        ReqId = c.Int(nullable: false, identity: true),
                        RefNo = c.String(),
                        EmpId = c.Int(),
                        StartDate = c.DateTime(),
                        ApprovedStatus = c.String(),
                        ApprovedDate = c.DateTime(),
                        ApprovedId = c.Int(),
                        ApprovedPosition = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReqId);
            
            CreateTable(
                "dbo.HrmMpDuty",
                c => new
                    {
                        DutyId = c.Int(nullable: false, identity: true),
                        DutyName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DutyId);
            
            CreateTable(
                "dbo.HrmMpScope",
                c => new
                    {
                        ScopeId = c.Int(nullable: false, identity: true),
                        ScopeName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ScopeId);
            
            CreateTable(
                "dbo.MasFamilyhood",
                c => new
                    {
                        FamId = c.Int(nullable: false, identity: true),
                        FamName = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FamId);
            
            CreateTable(
                "dbo.HrmPsEmpContact",
                c => new
                    {
                        ContactId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        NamePrefixId = c.Int(),
                        ContactName = c.String(),
                        ContactLastName = c.String(),
                        FamId = c.Int(),
                        ContactCareer = c.String(),
                        ContactAddress = c.String(),
                        DistrictId = c.Int(),
                        ContactPostalCode = c.String(),
                        Tel = c.String(),
                        Mobile = c.String(),
                        Email = c.String(),
                        ContactStatus = c.String(),
                        Citizen = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        HrmPsEmployees_EmpId = c.Int(),
                    })
                .PrimaryKey(t => t.ContactId);
            
            CreateTable(
                "dbo.MasCurrency",
                c => new
                    {
                        CurrencyId = c.Int(nullable: false, identity: true),
                        CurrencyName = c.String(),
                        CurrencyNameEng = c.String(),
                        Local = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                    })
                .PrimaryKey(t => t.CurrencyId);
            
            CreateTable(
                "dbo.HrmEsMoveRequest",
                c => new
                    {
                        ReqId = c.Int(nullable: false, identity: true),
                        RefNo = c.String(),
                        EmpId = c.Int(),
                        ApprovedStatus = c.String(),
                        ApprovedDate = c.DateTime(),
                        ApprovedId = c.Int(),
                        ApprovedPosition = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReqId);
            
            CreateTable(
                "dbo.HrmRcEntryType",
                c => new
                    {
                        EntTypeId = c.Int(nullable: false, identity: true),
                        EntTypeName = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EntTypeId);
            
            CreateTable(
                "dbo.MasBloodGroup",
                c => new
                    {
                        BloodGroupId = c.Int(nullable: false, identity: true),
                        BloodGroupName = c.String(),
                        BloodGroupNameEng = c.String(),
                        RecordStatus = c.String(),
                        Remarks = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BloodGroupId);
            
            CreateTable(
                "dbo.HrmTmpEmployee",
                c => new
                    {
                        TmpEmpId = c.Int(nullable: false, identity: true),
                        NamePrefixId = c.Int(),
                        FirstName = c.String(),
                        LastName = c.String(),
                        FirstNameEng = c.String(),
                        LastNameEng = c.String(),
                        NickName = c.String(),
                        GenderId = c.Int(),
                        ReligionId = c.Int(),
                        RaceNatId = c.Int(),
                        NatId = c.Int(),
                        BirthDate = c.DateTime(),
                        EmpStatusId = c.Int(),
                        Citizen = c.String(),
                        TaxPayer = c.String(),
                        Social = c.String(),
                        Official = c.String(),
                        BloodGroupId = c.Int(),
                        MarrStatId = c.Int(),
                        EntTypeId = c.Int(),
                        EmpTypeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TmpEmpId);
            
            CreateTable(
                "dbo.MasEduMajor",
                c => new
                    {
                        EduMajorId = c.Int(nullable: false, identity: true),
                        EduMajorCode = c.String(),
                        EduMajorName = c.String(),
                        EduMajorNameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EduMajorId);
            
            CreateTable(
                "dbo.MasEduInstitute",
                c => new
                    {
                        EduInsId = c.Int(nullable: false, identity: true),
                        EduInsCode = c.String(),
                        EduInsName = c.String(),
                        EduInsEng = c.String(),
                        EduGov = c.Int(),
                        Address = c.String(),
                        DistrictId = c.Int(),
                        PostalCode = c.String(),
                        Tel = c.String(),
                        Fax = c.String(),
                        CountryId = c.Int(),
                        MaxEduDegreeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EduInsId);
            
            CreateTable(
                "dbo.HrmTmpEmployeeEducation",
                c => new
                    {
                        TmpEduId = c.Int(nullable: false, identity: true),
                        TmpEmpId = c.Int(),
                        EduQualId = c.Int(),
                        EduMajorId = c.Int(),
                        EduInsId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        MasEduInstitute_EduInsId = c.Int(),
                        MasEduInstitutes_EduInsId = c.Int(),
                        MasEduMajor_EduMajorId = c.Int(),
                        MasEduMajors_EduMajorId = c.Int(),
                        MasEduQualifications_EduQualId = c.Int(),
                        TmpEmployee_TmpEmpId = c.Int(),
                        HrmTmpEmployees_TmpEmpId = c.Int(),
                        MasEduQualification_EduQualId = c.Int(),
                    })
                .PrimaryKey(t => t.TmpEduId);
            
            CreateTable(
                "dbo.MasEduQualification",
                c => new
                    {
                        EduQualId = c.Int(nullable: false, identity: true),
                        EduQualCode = c.String(),
                        EduQualName = c.String(),
                        EduQualNameEng = c.String(),
                        EduQualNameShort = c.String(),
                        EduDegreeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EduQualId);
            
            CreateTable(
                "dbo.MasEduDegree",
                c => new
                    {
                        EduDegreeId = c.Int(nullable: false, identity: true),
                        EduDegreeCode = c.String(),
                        EduDegreeName = c.String(),
                        EduDegreeNameEng = c.String(),
                        EduDegreeQualification = c.String(),
                        ComparativeLevel = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EduDegreeId);
            
            CreateTable(
                "dbo.HrmPsEduHistory",
                c => new
                    {
                        EduHisId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(),
                        EduDegreeId = c.Int(),
                        EduQualId = c.Int(),
                        EduMajorId = c.Int(),
                        EduInsId = c.Int(),
                        EduStartYear = c.Int(),
                        EduEndYear = c.Int(),
                        StartDate = c.DateTime(),
                        EndDate = c.DateTime(),
                        Gpa = c.Decimal(precision: 18, scale: 2),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        HrmPsEmployees_EmpId = c.Int(),
                    })
                .PrimaryKey(t => t.EduHisId);
            
            CreateTable(
                "dbo.HrmMpPositionType",
                c => new
                    {
                        PosTypeId = c.Int(nullable: false, identity: true),
                        PosTypeName = c.String(),
                        PosTypeNameShort = c.String(),
                        PosTypeEng = c.String(),
                        PosTypeEngShort = c.String(),
                        EmpTypeId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        HrmPsEmployeeTypes_EmpTypeId = c.Int(),
                    })
                .PrimaryKey(t => t.PosTypeId);
            
            CreateTable(
                "dbo.HrmMpClass",
                c => new
                    {
                        ClassId = c.Int(nullable: false, identity: true),
                        ClassNo = c.String(),
                        ClassName = c.String(),
                        ClassNameShort = c.String(),
                        ClassEng = c.String(),
                        ClassEngShort = c.String(),
                        PosTypeId = c.Int(),
                        EmpTypeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        Remarks = c.String(),
                    })
                .PrimaryKey(t => t.ClassId);
            
            CreateTable(
                "dbo.HrmPsCommandDtls",
                c => new
                    {
                        CmdDtlsId = c.Int(nullable: false, identity: true),
                        CmdId = c.Int(nullable: false),
                        EmpId = c.Int(nullable: false),
                        StartDate = c.DateTime(nullable: false),
                        EndDate = c.DateTime(),
                        EduHisId = c.Int(),
                        Remarks = c.String(),
                        RptRemarks = c.String(),
                        MoveId = c.Int(),
                        OldPosId = c.Int(),
                        OldPosRef = c.String(),
                        OldPosName = c.String(),
                        OldExecPosName = c.String(),
                        OldClassId = c.Int(),
                        OldJobSiteId = c.Int(),
                        OldJobSiteName = c.String(),
                        OldWorkingJobSiteId = c.Int(),
                        OldWorkingJobSiteName = c.String(),
                        OldSalary = c.Double(),
                        OldExecSalary = c.Double(),
                        OldPosLine = c.String(),
                        OldPosTypeId = c.Int(),
                        OldExecPosId = c.Int(),
                        NewPosId = c.Int(),
                        NewPosRef = c.String(),
                        NewPosName = c.String(),
                        NewExecPosName = c.String(),
                        NewClassId = c.Int(),
                        NewJobSiteId = c.Int(),
                        NewJobSiteName = c.String(),
                        NewWorkingJobSiteId = c.Int(),
                        NewWorkingJobSiteName = c.String(),
                        NewSalary = c.Double(),
                        NewExecSalary = c.Double(),
                        NewPosLine = c.String(),
                        NewPosTypeId = c.Int(),
                        NewExecPosId = c.Int(),
                        OldDepName = c.String(),
                        OldWorkingDepName = c.String(),
                        NewDepName = c.String(),
                        NewWorkingDepName = c.String(),
                        PrmBase = c.Double(),
                        PrmPercent = c.Decimal(precision: 18, scale: 2),
                        PrmAmount = c.Double(),
                        Remarks2 = c.String(),
                        EntNo = c.Int(),
                        EntPosName = c.String(),
                        EntPosTypeId = c.Int(),
                        EntClassId = c.Int(),
                        EntJobSiteName = c.String(),
                        EntDate = c.DateTime(),
                        BackDate = c.DateTime(),
                        TmpEmpId = c.Int(),
                        TmpEduId = c.Int(),
                        CurrPosClassDate = c.DateTime(),
                        QuitDate = c.DateTime(),
                        CurrencyId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        old_HrmMpPositions_PosId = c.Int(),
                        old_HrmMpClasses_ClassId = c.Int(),
                        old_HrmMpJobSites_JobSiteId = c.Int(),
                        old_working_HrmMpJobSites_JobSiteId = c.Int(),
                        old_HrmMpExecPositions_ExecPosId = c.Int(),
                        new_HrmMpPositions_PosId = c.Int(),
                        new_HrmMpClasses_ClassId = c.Int(),
                        new_HrmMpJobSites_JobSiteId = c.Int(),
                        new_working_HrmMpJobSites_JobSiteId = c.Int(),
                        new_HrmMpExecPositions_ExecPosId = c.Int(),
                    })
                .PrimaryKey(t => t.CmdDtlsId);
            
            CreateTable(
                "dbo.HrmDcPenalty",
                c => new
                    {
                        PenId = c.Int(nullable: false, identity: true),
                        PenName = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PenId);
            
            CreateTable(
                "dbo.HrmPsCommandGroup",
                c => new
                    {
                        CmdGroupId = c.Int(nullable: false, identity: true),
                        CmdGroupName = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CmdGroupId);
            
            CreateTable(
                "dbo.HrmPsCommandType",
                c => new
                    {
                        CmdTypeId = c.Int(nullable: false, identity: true),
                        CmdTypeCode = c.String(),
                        CmdTypeName = c.String(),
                        CmdTypeNameShort = c.String(),
                        CmdGroupId = c.Int(),
                        RptFormat = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        RptHeader = c.String(),
                        HrmPsCommandGroups_CmdGroupId = c.Int(),
                    })
                .PrimaryKey(t => t.CmdTypeId);
            
            CreateTable(
                "dbo.HrmPsCommand",
                c => new
                    {
                        CmdId = c.Int(nullable: false, identity: true),
                        CmdFlag = c.String(nullable: false),
                        CmdDraftNo = c.String(),
                        CmdName = c.String(nullable: false),
                        CmdDescr = c.String(unicode: false, storeType: "text"),
                        CmdRefNo = c.String(nullable: false),
                        CmdTypeId = c.Int(nullable: false),
                        EmpTypeId = c.Int(nullable: false),
                        JobSiteId = c.Int(),
                        PenaltyId = c.Int(),
                        CmdStatus = c.String(),
                        ApprovedId = c.Int(),
                        ApprovedName = c.String(),
                        ApprovedPositions = c.String(),
                        ApprovedDate = c.DateTime(),
                        CmdRptDate = c.String(),
                        Confirm = c.Int(),
                        RptHeader = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        HrmPsCommandTypes_CmdTypeId = c.Int(),
                        HrmPsEmployeeTypes_EmpTypeId = c.Int(),
                        HrmMpJobSites_JobSiteId = c.Int(),
                        approver_EmpId = c.Int(),
                        HrmDcPenalty_PenId = c.Int(),
                    })
                .PrimaryKey(t => t.CmdId);
            
            CreateTable(
                "dbo.SysPermission",
                c => new
                    {
                        PermissionId = c.Int(nullable: false, identity: true),
                        RoleId = c.Int(nullable: false),
                        PermissionType = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PermissionId);
            
            CreateTable(
                "dbo.SysUserRole",
                c => new
                    {
                        UserRoleId = c.Int(nullable: false, identity: true),
                        UserId = c.Int(nullable: false),
                        PosId = c.Int(),
                        RoleId = c.Int(nullable: false),
                        EmpTypeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.UserRoleId);
            
            CreateTable(
                "dbo.SysRole",
                c => new
                    {
                        RoleId = c.Int(nullable: false, identity: true),
                        RoleName = c.String(),
                        System = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RoleId);
            
            CreateTable(
                "dbo.SysMenuItemList",
                c => new
                    {
                        MenuItemId = c.Int(nullable: false, identity: true),
                        MenuItemCode = c.String(),
                        MenuItemName = c.String(),
                        UpperMenuItemId = c.String(),
                        MenuItemPath = c.String(),
                        MenuItemTarget = c.String(),
                        SystemId = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MenuItemId);
            
            CreateTable(
                "dbo.MessageReply",
                c => new
                    {
                        ReplyId = c.Int(nullable: false, identity: true),
                        ReplyDate = c.DateTime(),
                        RefNo = c.String(),
                        ReplyType = c.String(),
                        ReplyText = c.String(),
                        FromEmpId = c.Int(),
                        ToEmpId = c.Int(),
                        FromSendId = c.Int(),
                        Remarks = c.String(),
                        MessageStatus = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReplyId);
            
            CreateTable(
                "dbo.MessageSend",
                c => new
                    {
                        SendId = c.Int(nullable: false, identity: true),
                        SendDate = c.DateTime(nullable: false),
                        RefId = c.Int(),
                        RefType = c.String(),
                        RefNo = c.String(),
                        SendText = c.String(),
                        FromEmpId = c.Int(),
                        ToEmpId = c.Int(),
                        FromSendId = c.Int(),
                        Remarks = c.String(),
                        MessageStatus = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.SendId);
            
            CreateTable(
                "dbo.MessageWarning",
                c => new
                    {
                        MessageId = c.Int(nullable: false, identity: true),
                        MessageTh = c.String(),
                        MessageEn = c.String(),
                        MessageType = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MessageId);
            
            CreateTable(
                "dbo.Message",
                c => new
                    {
                        MessageId = c.Int(nullable: false, identity: true),
                        MessageNo = c.String(),
                        MessageDate = c.DateTime(),
                        MessageTitle = c.String(),
                        MessageDescr = c.String(),
                        FromEmpId = c.Int(),
                        ToEmpId = c.Int(),
                        FromMessageId = c.Int(),
                        ApprovalTaskId = c.Int(),
                        ApprovalTaskHistoryId = c.Int(),
                        RuleApproveId = c.Int(),
                        Remarks = c.String(),
                        MessageStatus = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        ActionCount = c.Int(),
                    })
                .PrimaryKey(t => t.MessageId);
            
            CreateTable(
                "dbo.SysMessage",
                c => new
                    {
                        MessageId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Date = c.DateTime(),
                        Title = c.String(),
                        Description = c.String(),
                        FromEmpId = c.Int(),
                        ToEmpId = c.Int(),
                        FromMessageID = c.Int(),
                        ApprovalTaskID = c.Int(),
                        RuleApproveID = c.Int(),
                        Remarks = c.String(),
                        MessageStatus = c.Int(nullable: false),
                        ActionCount = c.Int(nullable: false),
                        RuleApprove = c.Int(nullable: false),
                        ApprovalTask = c.Int(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MessageId);
            
            CreateTable(
                "dbo.SysUser",
                c => new
                    {
                        UserId = c.Int(nullable: false, identity: true),
                        Code = c.String(nullable: false),
                        Password = c.String(),
                        EmpId = c.Int(),
                        IsAdmin = c.Boolean(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.UserId);
            
            CreateTable(
                "dbo.SysOTP",
                c => new
                    {
                        UniqueId = c.Guid(nullable: false),
                    })
                .PrimaryKey(t => t.UniqueId);
            
            CreateTable(
                "dbo.SysUserLoginLogout",
                c => new
                    {
                        UserId = c.Int(nullable: false),
                        ClientIp = c.String(nullable: false, maxLength: 128),
                        SystemId = c.String(nullable: false, maxLength: 128),
                        UserCode = c.String(),
                        FullName = c.String(),
                        PosId = c.Int(),
                        LoginDateTime = c.DateTime(nullable: false),
                        LogoutDateTime = c.DateTime(),
                    })
                .PrimaryKey(t => new { t.UserId, t.ClientIp, t.SystemId });
            
            CreateTable(
                "dbo.SysUserLoginMonitor",
                c => new
                    {
                        UserId = c.Int(nullable: false),
                        ClientIp = c.String(nullable: false, maxLength: 128),
                        SystemId = c.String(nullable: false, maxLength: 128),
                        UserCode = c.String(),
                        FullName = c.String(),
                        PosId = c.Int(),
                        CurrentStatus = c.String(),
                        DateTimeInit = c.DateTime(nullable: false),
                        Icon = c.String(),
                    })
                .PrimaryKey(t => new { t.UserId, t.ClientIp, t.SystemId });
            
            CreateTable(
                "dbo.IcmPurchaseOrderItem",
                c => new
                    {
                        PoItemId = c.Int(nullable: false, identity: true),
                        PoId = c.Int(nullable: false),
                        BidderQuoId = c.Int(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PoItemId);
            
            CreateTable(
                "dbo.IcmDeliveryNoteItemExtra",
                c => new
                    {
                        DnItemExtraId = c.Int(nullable: false, identity: true),
                        DnId = c.Int(),
                        ResItemId = c.Int(),
                        Qty = c.Int(),
                        Price = c.Double(),
                        Descr = c.String(),
                        Remarks = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DnItemExtraId);
            
            CreateTable(
                "dbo.IcmMovementHistory",
                c => new
                    {
                        MoveHistId = c.Int(nullable: false, identity: true),
                        AssetId = c.Int(nullable: false),
                        MoveQty = c.Int(nullable: false),
                        SourceLocation = c.String(),
                        DestinationLocation = c.String(),
                        MoveRefNo = c.String(maxLength: 30),
                        MovementType = c.String(maxLength: 50),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MoveHistId);
            
            CreateTable(
                "dbo.IcmFile",
                c => new
                    {
                        FileId = c.Int(nullable: false, identity: true),
                        RefId = c.Int(nullable: false),
                        RefType = c.Int(nullable: false),
                        FileName = c.String(nullable: false),
                        FilePath = c.String(nullable: false),
                        FileType = c.String(nullable: false),
                        FileExtention = c.String(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        Employee_EmpId = c.Int(),
                    })
                .PrimaryKey(t => t.FileId);
            
            CreateTable(
                "dbo.IcmCommittee",
                c => new
                    {
                        CommitteeId = c.Int(nullable: false, identity: true),
                        RefId = c.Int(nullable: false),
                        RefType = c.Int(nullable: false),
                        ComFunctionId = c.Int(),
                        ComPositionId = c.Int(),
                        Code = c.String(nullable: false),
                        ComTypeId = c.Int(),
                        EmpId = c.Int(),
                        EmpName = c.String(nullable: false),
                        EmpPositionName = c.String(),
                        DeleteReason = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CommitteeId);
            
            CreateTable(
                "dbo.IcmMovementDtl",
                c => new
                    {
                        MovementDtlId = c.Int(nullable: false, identity: true),
                        MovementId = c.Int(nullable: false),
                        AssetId = c.Int(nullable: false),
                        MoveQty = c.Int(nullable: false),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MovementDtlId);
            
            CreateTable(
                "dbo.IcmMovement",
                c => new
                    {
                        MovementId = c.Int(nullable: false, identity: true),
                        Title = c.String(nullable: false),
                        ResTypeId = c.Int(nullable: false),
                        RefNo = c.String(),
                        MoveMethod = c.Int(nullable: false),
                        SourceWarehouseId = c.Int(),
                        SourceJobSiteId = c.Int(),
                        DestinationWarehouseId = c.Int(nullable: false),
                        Remark = c.String(),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MovementId);
            
            CreateTable(
                "dbo.IcmDispenseHistory",
                c => new
                    {
                        DispenseHisId = c.Int(nullable: false, identity: true),
                        ResItemId = c.Int(),
                        LotNo = c.String(maxLength: 50),
                        WhId = c.Int(),
                        Quantity = c.Int(),
                        Price = c.Decimal(precision: 18, scale: 2),
                        RefNo = c.String(maxLength: 50),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        DispenseId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.DispenseHisId);
            
            CreateTable(
                "dbo.IcmDispense",
                c => new
                    {
                        DispenseId = c.Int(nullable: false, identity: true),
                        DispenseName = c.String(),
                        DispenseDate = c.DateTime(),
                        WhId = c.Int(),
                        FromJobSiteId = c.Int(nullable: false),
                        RequestParcelId = c.Int(nullable: false),
                        ProjectId = c.Int(nullable: false),
                        RequestById = c.Int(nullable: false),
                        Remark = c.String(),
                        ApprovedBy = c.Int(),
                        ApprovedWhen = c.DateTime(),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DispenseId);
            
            CreateTable(
                "dbo.IcmRequestParcelDtl",
                c => new
                    {
                        ReqDtlId = c.Int(nullable: false, identity: true),
                        ReqId = c.Int(),
                        ResItemId = c.Int(),
                        PprId = c.Int(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        Quantity = c.Decimal(precision: 18, scale: 2),
                        ItemName = c.String(),
                        RequestType = c.String(),
                        RequestTypeCode = c.String(),
                        JobsiteId = c.Int(nullable: false),
                        RecordStatus = c.String(maxLength: 2),
                        DispenseStatus = c.String(maxLength: 10),
                    })
                .PrimaryKey(t => t.ReqDtlId);
            
            CreateTable(
                "dbo.IcmRequestParcel",
                c => new
                    {
                        ReqParcelId = c.Int(nullable: false, identity: true),
                        IcmReqCode = c.String(nullable: false),
                        IcmResItemCode = c.String(),
                        JobSiteId = c.Int(),
                        RequestName = c.String(nullable: false),
                        WarehousePermitId = c.Int(nullable: false),
                        Remarks = c.String(),
                        RequestBy = c.Int(nullable: false),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        IcmResTypeId = c.Int(),
                        WantedDate = c.DateTime(nullable: false),
                        ApprovedBy = c.Int(),
                        ApprovedDate = c.DateTime(),
                        Reason = c.String(),
                        RecordStatus = c.String(maxLength: 2),
                        ProjectId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.ReqParcelId);
            
            CreateTable(
                "dbo.IcmOfficeSuppliesLot",
                c => new
                    {
                        OfficeSuppliesLotId = c.Int(nullable: false, identity: true),
                        ResItemId = c.Int(),
                        LotNo = c.String(nullable: false, maxLength: 50),
                        Description = c.String(nullable: false),
                        Quantity = c.Int(nullable: false),
                        Price = c.Decimal(nullable: false, precision: 18, scale: 2),
                        WhId = c.Int(),
                        ProjExpId = c.Int(),
                        ReceiveDtlId = c.Int(),
                        UnitId = c.Int(),
                        ExpireDate = c.DateTime(),
                        PicturePath = c.String(),
                        Remark = c.String(),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.OfficeSuppliesLotId);
            
            CreateTable(
                "dbo.IcmAssetWarranty",
                c => new
                    {
                        WarrantyId = c.Int(nullable: false, identity: true),
                        AssetId = c.Int(nullable: false),
                        WarrantyNo = c.String(nullable: false, maxLength: 50),
                        WarrantyPrice = c.Decimal(nullable: false, precision: 18, scale: 2),
                        WarrantyTime = c.Int(nullable: false),
                        WarrantyStartDate = c.DateTime(nullable: false),
                        WarrantyExpireDate = c.DateTime(nullable: false),
                        Description = c.String(maxLength: 255),
                        Remark = c.String(),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.WarrantyId);
            
            CreateTable(
                "dbo.IcmAsset",
                c => new
                    {
                        AssetId = c.Int(nullable: false, identity: true),
                        AssetCode = c.String(nullable: false, maxLength: 23),
                        ResItemId = c.Int(nullable: false),
                        AssetName = c.String(nullable: false),
                        AssetDate = c.DateTime(nullable: false),
                        SerialNumber = c.String(nullable: false, maxLength: 50),
                        IsLowerAsset = c.Boolean(),
                        Quantity = c.Int(nullable: false),
                        Price = c.Double(nullable: false),
                        WhId = c.Int(nullable: false),
                        UnitId = c.Int(nullable: false),
                        AssetTypeId = c.Int(),
                        QualityAssuranceExpireDate = c.DateTime(),
                        ProjExpId = c.Int(),
                        ReceiveDtlId = c.Int(nullable: false),
                        ResSubGrpId = c.Int(nullable: false),
                        ResGrpId = c.Int(nullable: false),
                        AssetStatusId = c.Int(nullable: false),
                        DepreciationTypeId = c.Int(),
                        JobSiteId = c.Int(),
                        Description = c.String(),
                        PicturePath = c.String(),
                        Place = c.String(),
                        Remark = c.String(),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AssetId);
            
            CreateTable(
                "dbo.IcmReceiveDtl",
                c => new
                    {
                        ReceiveDtlId = c.Int(nullable: false, identity: true),
                        ReceiveId = c.Int(),
                        DeliveryNoteItemId = c.Int(nullable: false),
                        IsByPassInventory = c.Boolean(),
                        ResourceItemId = c.Int(),
                        ResourceTypeId = c.Int(),
                        UnitId = c.Int(),
                        DepreciationTypeId = c.Int(),
                        ProjExpId = c.Int(),
                        Quantity = c.Int(nullable: false),
                        Price = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Remark = c.String(),
                        Description = c.String(),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReceiveDtlId);
            
            CreateTable(
                "dbo.IcmWarehousePermit",
                c => new
                    {
                        WarehousePermitId = c.Int(nullable: false, identity: true),
                        WhId = c.Int(nullable: false),
                        JobSiteId = c.Int(nullable: false),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.WarehousePermitId);
            
            CreateTable(
                "dbo.IcmReceive",
                c => new
                    {
                        ReceiveId = c.Int(nullable: false, identity: true),
                        ReceiveCode = c.String(),
                        ReceiveName = c.String(nullable: false),
                        ReceiveTypeId = c.Int(nullable: false),
                        ReceiveDate = c.DateTime(nullable: false, storeType: "datetime2"),
                        DnId = c.Int(),
                        WhId = c.Int(nullable: false),
                        RefNo = c.String(),
                        Remark = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReceiveId);
            
            CreateTable(
                "dbo.IcmMasContactPartner",
                c => new
                    {
                        ConPartId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Descr = c.String(),
                        ConId = c.Int(nullable: false),
                        CitizenId = c.String(maxLength: 13),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ConPartId);
            
            CreateTable(
                "dbo.IcmMasContactBank",
                c => new
                    {
                        ConBankId = c.Int(nullable: false, identity: true),
                        ConId = c.Int(nullable: false),
                        BranchId = c.Int(),
                        AccountCode = c.String(),
                        AccountName = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ConBankId);
            
            CreateTable(
                "dbo.IcmMasPurchaseRegularMapping",
                c => new
                    {
                        RegularMapId = c.Int(nullable: false, identity: true),
                        RegularId = c.Int(nullable: false),
                        BgSourceId = c.Int(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RegularMapId);
            
            CreateTable(
                "dbo.FimMasFund",
                c => new
                    {
                        FundId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        ConId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FundId);
            
            CreateTable(
                "dbo.FimEmployeeTax",
                c => new
                    {
                        EmpTaxId = c.Int(nullable: false, identity: true),
                        EmpId = c.Int(nullable: false),
                        FundTypeId = c.Int(),
                        FundPlusPer = c.Double(),
                        InsAmount = c.Double(),
                        RmfAmount = c.Double(),
                        LtfAmount = c.Double(),
                        LoanAmount = c.Double(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpTaxId);
            
            CreateTable(
                "dbo.IcmPurchaseOrderPenalty",
                c => new
                    {
                        PoPenId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Descr = c.String(),
                        PenaltyRate = c.Double(),
                        RateTypeId = c.Int(),
                        PenaltyLeast = c.Double(),
                        PoId = c.Int(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PoPenId);
            
            CreateTable(
                "dbo.IcmDeliveryNotePenalty",
                c => new
                    {
                        DnPenId = c.Int(nullable: false, identity: true),
                        DnId = c.Int(),
                        PoPenId = c.Int(),
                        Remarks = c.String(),
                        PenaltyCalculate = c.Int(),
                        PenaltyAmount = c.Double(),
                        PenaltyFinalAmount = c.Double(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DnPenId);
            
            CreateTable(
                "dbo.FimReceive",
                c => new
                    {
                        ReceiveId = c.Long(nullable: false, identity: true),
                        BgSourceId = c.Int(nullable: false),
                        WorkAreaId = c.Int(),
                        BgYear = c.Int(nullable: false),
                        ReceiveTypeId = c.Int(),
                        ReceiptNo = c.String(),
                        ReceiveDate = c.DateTime(),
                        ManualReceipt = c.Boolean(nullable: false),
                        ReceiveMode = c.String(),
                        ReceiveMethodId = c.Int(),
                        ChequeNo = c.String(),
                        BranchId = c.Int(),
                        BankAccId = c.Int(),
                        ContactId = c.Int(),
                        EmpId = c.Int(),
                        TempContact = c.String(),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        ReceivedBy = c.Int(),
                        Remarks = c.String(),
                        BidderId = c.Int(),
                        BidOfferColId = c.Int(),
                        PoColId = c.Int(),
                        PrePayColId = c.Int(),
                        DnPenId = c.Int(),
                        PoInstalId = c.Int(),
                        TranGrpId = c.Int(),
                        TransferId = c.Int(),
                        PetitionId = c.Long(),
                        PayReqId = c.Int(),
                        PayId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReceiveId);
            
            CreateTable(
                "dbo.FimPayCheque",
                c => new
                    {
                        PayChequeId = c.Int(nullable: false, identity: true),
                        PayId = c.Int(nullable: false),
                        ChequeId = c.Int(nullable: false),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PayChequeId);
            
            CreateTable(
                "dbo.FimPayRequestDtlRate",
                c => new
                    {
                        PayReqDtlRateId = c.Int(nullable: false, identity: true),
                        PayRequestDtlId = c.Int(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PayReqDtlRateId);
            
            CreateTable(
                "dbo.FimCheque",
                c => new
                    {
                        ChequeId = c.Int(nullable: false, identity: true),
                        ChequeBookId = c.Int(nullable: false),
                        ChequeNo = c.Int(nullable: false),
                        PrintDate = c.DateTime(),
                        PayDate = c.DateTime(),
                        Receiver = c.String(),
                        Remarks = c.String(),
                        ChequeStatus = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ChequeId);
            
            CreateTable(
                "dbo.FimChequeBook",
                c => new
                    {
                        ChequeBookId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        BankAccId = c.Int(nullable: false),
                        StartChequeNo = c.Int(nullable: false),
                        EndChequeNo = c.Int(nullable: false),
                        Remarks = c.String(),
                        ChequeBookStatus = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ChequeBookId);
            
            CreateTable(
                "dbo.FimMasBorrowType",
                c => new
                    {
                        BorrowTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        BgSourceId = c.Int(),
                        CalDateType = c.String(),
                        ReturnDay = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BorrowTypeId);
            
            CreateTable(
                "dbo.FimMasReceiveType",
                c => new
                    {
                        ReceiveTypeId = c.Int(nullable: false, identity: true),
                        BgSourceId = c.Int(nullable: false),
                        Name = c.String(),
                        BankAccId = c.Int(),
                        AccountId = c.Int(),
                        InvConnectType = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReceiveTypeId);
            
            CreateTable(
                "dbo.FimMasBankAccountTypeGroup",
                c => new
                    {
                        BankAccTypeGrpId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BankAccTypeGrpId);
            
            CreateTable(
                "dbo.FimMasBankAccountType",
                c => new
                    {
                        BankAccTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        BankAccTypeGrpId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BankAccTypeId);
            
            CreateTable(
                "dbo.FimMasExpenseRate",
                c => new
                    {
                        ExpRateId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Descr = c.String(),
                        BgExpId = c.Int(),
                        BgSourceId = c.Int(),
                        AmountMax = c.Double(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ExpRateId);
            
            CreateTable(
                "dbo.bgm_system_control",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        bgm_sys_control_name = c.String(storeType: "ntext"),
                        bgm_sys_control_values = c.String(storeType: "ntext"),
                    })
                .PrimaryKey(t => t.id);
            
            CreateTable(
                "dbo.bgm_mas_strategy_type",
                c => new
                    {
                        bgm_strat_type_seq = c.Int(nullable: false, identity: true),
                        bgm_strat_type_code = c.String(storeType: "ntext"),
                        bgm_strat_type_name = c.String(storeType: "ntext"),
                        bgm_strat_type_descr = c.String(storeType: "ntext"),
                        is_root = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_strat_type_seq);
            
            CreateTable(
                "dbo.bgm_strategy_data_list",
                c => new
                    {
                        bgm_strat_list_seq = c.Int(nullable: false, identity: true),
                        bgm_strat_list_code = c.String(storeType: "ntext"),
                        bgm_strat_list_name = c.String(storeType: "ntext"),
                        bgm_strat_list_descr = c.String(storeType: "ntext"),
                        bgm_strat_type_seq = c.Int(),
                        gfmis_code = c.String(storeType: "ntext"),
                        year_start = c.Int(),
                        year_end = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_strat_list_seq);
            
            CreateTable(
                "dbo.bgm_project_type",
                c => new
                    {
                        prj_type_seq = c.Int(nullable: false, identity: true),
                        prj_type_name = c.String(storeType: "ntext"),
                        prj_type_descr = c.String(storeType: "ntext"),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.prj_type_seq);
            
            CreateTable(
                "dbo.bgm_mas_scopes",
                c => new
                    {
                        bgm_scope_seq = c.Int(nullable: false, identity: true),
                        bgm_scope_name = c.String(storeType: "ntext"),
                        remarks = c.String(storeType: "ntext"),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_scope_seq);
            
            CreateTable(
                "dbo.IcmBidderCollateral",
                c => new
                    {
                        BidderColId = c.Int(nullable: false, identity: true),
                        ColTypeId = c.Int(),
                        Code = c.String(),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        Descr = c.String(),
                        BidderId = c.Int(),
                        ReceiptNo = c.String(),
                        ReturnDate = c.DateTime(),
                        ColStatusId = c.Int(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        ColCategoryId = c.Int(),
                    })
                .PrimaryKey(t => t.BidderColId);
            
            CreateTable(
                "dbo.FimPay",
                c => new
                    {
                        PayId = c.Int(nullable: false, identity: true),
                        BgSourceId = c.Int(nullable: false),
                        WorkAreaId = c.Int(nullable: false),
                        BgYear = c.Int(nullable: false),
                        PayEventId = c.Int(nullable: false),
                        PayDate = c.DateTime(),
                        RealPayDate = c.DateTime(),
                        Code = c.String(),
                        ReceiptNo = c.String(),
                        ReceiptName = c.String(),
                        Name = c.String(),
                        PayMethodId = c.Int(),
                        PayReqId = c.Int(),
                        PetitionId = c.Long(),
                        PetitionDtlId = c.Int(),
                        EmpId = c.Int(),
                        ContactId = c.Int(),
                        TempContactName = c.String(),
                        BidderColId = c.Int(),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        VatRate = c.Decimal(precision: 18, scale: 2),
                        Vat = c.Decimal(precision: 18, scale: 2),
                        TaxRate = c.Decimal(precision: 18, scale: 2),
                        Tax = c.Decimal(precision: 18, scale: 2),
                        NetAmount = c.Decimal(precision: 18, scale: 2),
                        PostPayId = c.Int(),
                        TranGrpId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PayId);
            
            CreateTable(
                "dbo.FimPetition",
                c => new
                    {
                        PetitionId = c.Long(nullable: false, identity: true),
                        BgSourceId = c.Int(nullable: false),
                        BgYear = c.Int(nullable: false),
                        PetitionDate = c.DateTime(),
                        Code = c.String(),
                        DirectPay = c.Boolean(nullable: false),
                        PetitionTypeId = c.Int(nullable: false),
                        RealPetitionDate = c.DateTime(),
                        PetitionNo = c.String(),
                        TranGrpId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PetitionId);
            
            CreateTable(
                "dbo.FimPetitionDtl",
                c => new
                    {
                        PetitionDtlId = c.Int(nullable: false, identity: true),
                        PetitionId = c.Long(),
                        PayReqId = c.Int(),
                        JobSiteId = c.Int(),
                        Amount = c.Double(),
                        AmountTax = c.Double(),
                        AmountPenalty = c.Double(),
                        AmountRedemption = c.Double(),
                        AmountFund = c.Double(),
                        AmountReal = c.Double(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PetitionDtlId);
            
            CreateTable(
                "dbo.FimReturn",
                c => new
                    {
                        ReturnId = c.Int(nullable: false, identity: true),
                        ReturnDate = c.DateTime(),
                        Code = c.String(),
                        PayReqId = c.Int(),
                        TranGrpId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReturnId);
            
            CreateTable(
                "dbo.FimReturnDtl",
                c => new
                    {
                        ReturnDtlId = c.Int(nullable: false, identity: true),
                        ReturnId = c.Int(),
                        PayReqDtlId = c.Int(),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReturnDtlId);
            
            CreateTable(
                "dbo.FimPayRequest",
                c => new
                    {
                        PayReqId = c.Int(nullable: false, identity: true),
                        BgSourceId = c.Int(nullable: false),
                        BgYear = c.Int(nullable: false),
                        WorkAreaId = c.Int(),
                        ExpGrpId = c.Int(),
                        PayEventId = c.Int(),
                        PayReqDate = c.DateTime(),
                        UseAdvance = c.String(),
                        AdvanceBgSourceId = c.Int(),
                        Code = c.String(),
                        DoccumentNo = c.String(),
                        Name = c.String(),
                        ProjOperId = c.Int(),
                        EmpId = c.Int(),
                        JobSiteId = c.Int(),
                        ContactId = c.Int(),
                        DnId = c.Int(),
                        BorrowNo = c.String(),
                        BorrowTypeId = c.Int(),
                        BorrowStartDate = c.DateTime(),
                        BorrowEndDate = c.DateTime(),
                        BorrowReturnDate = c.DateTime(),
                        CreditCardNo = c.String(),
                        Allow = c.String(),
                        DebtorEmpId = c.Int(),
                        DebtorContactId = c.Int(),
                        TranGrpId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PayReqId);
            
            CreateTable(
                "dbo.FimPayRequestDtl",
                c => new
                    {
                        PayReqDtlId = c.Int(nullable: false, identity: true),
                        PayReqId = c.Int(nullable: false),
                        Name = c.String(),
                        ProjOperExpId = c.Int(),
                        JobSiteId = c.Int(),
                        PercentVat = c.Double(),
                        PercentTax = c.Double(),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        AmountVat = c.Decimal(precision: 18, scale: 2),
                        AmountTax = c.Decimal(precision: 18, scale: 2),
                        NetAmount = c.Decimal(precision: 18, scale: 2),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PayReqDtlId);
            
            CreateTable(
                "dbo.IcmWarehouse",
                c => new
                    {
                        WhId = c.Int(nullable: false, identity: true),
                        Name = c.String(nullable: false),
                        Description = c.String(),
                        ScopeId = c.Int(nullable: false),
                        JobSiteId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.WhId);
            
            CreateTable(
                "dbo.IcmDeliveryNote",
                c => new
                    {
                        DnId = c.Int(nullable: false, identity: true),
                        PoId = c.Int(),
                        PoInstallId = c.Int(),
                        Code = c.String(),
                        Name = c.String(),
                        Descr = c.String(),
                        ReceiveDate = c.DateTime(),
                        InvoiceNumber = c.String(),
                        InvoiceDate = c.DateTime(),
                        WhId = c.Int(),
                        DocumentNumber = c.String(),
                        RedemptionAmount = c.Double(),
                        DeductionAmount = c.Double(),
                        YearTypeId = c.Int(),
                        BgYear = c.Int(),
                        DeliveryDate = c.DateTime(),
                        DeliveryEmpId = c.Int(),
                        DeliveryJobSiteId = c.Int(),
                        DeliveryPlace = c.String(),
                        ProgId = c.Int(),
                        TranGrpId = c.Int(),
                        ProjOperExpId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DnId);
            
            CreateTable(
                "dbo.IcmDeliveryNoteItem",
                c => new
                    {
                        DnItemId = c.Int(nullable: false, identity: true),
                        DnId = c.Int(),
                        PoInstallItemId = c.Int(),
                        ResItemId = c.Int(),
                        ItemQty = c.Int(),
                        NumberOfcount = c.Int(),
                        Descr = c.String(),
                        ItemPriceExcludeVat = c.Double(),
                        ItemPriceIncludeVat = c.Double(),
                        Remarks = c.String(),
                        ExcludeVatAmount = c.Double(),
                        VatAmount = c.Double(),
                        NetAmount = c.Double(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DnItemId);
            
            CreateTable(
                "dbo.IcmPurchaseOrder",
                c => new
                    {
                        PoId = c.Int(nullable: false, identity: true),
                        BidderId = c.Int(),
                        Gfmis = c.String(),
                        Code = c.String(),
                        Name = c.String(),
                        Descr = c.String(),
                        PcTypeId = c.Int(),
                        CanInstallment = c.String(),
                        CanSeparateDetail = c.String(),
                        NotSeparateReason = c.String(),
                        PenaltyType = c.String(),
                        RequireDuration = c.Int(),
                        RequireDate = c.DateTime(),
                        DurTypeId = c.Int(),
                        DateStartCount = c.DateTime(),
                        DeliveryDate = c.DateTime(),
                        PrepayAmount = c.Double(),
                        RedemptionPercent = c.Double(),
                        DateReturnPrepay = c.DateTime(),
                        DateReturnContract = c.DateTime(),
                        DateReturnRedemption = c.DateTime(),
                        OrderDate = c.DateTime(),
                        YearTypeId = c.Int(),
                        BgYear = c.Int(),
                        ProgressId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PoId);
            
            CreateTable(
                "dbo.IcmPurchaseOrderInstallment",
                c => new
                    {
                        PoInstallId = c.Int(nullable: false, identity: true),
                        PoId = c.Int(),
                        InstallNumber = c.Int(),
                        DeliveryDate = c.DateTime(),
                        Remarks = c.String(),
                        RedemptionAmount = c.Double(),
                        DeductionAmount = c.Double(),
                        RequireDuration = c.Int(),
                        DurTypeId = c.Int(),
                        RequireDate = c.DateTime(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PoInstallId);
            
            CreateTable(
                "dbo.IcmBid",
                c => new
                    {
                        BidId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        Descr = c.String(),
                        PrId = c.Int(nullable: false),
                        YearTypeId = c.Int(),
                        BgYear = c.Int(),
                        BidDate = c.DateTime(),
                        BidEmpId = c.Int(),
                        BidJobSiteId = c.Int(),
                        ConfirmDate = c.DateTime(),
                        ConfirmEmpId = c.Int(),
                        CancelDate = c.DateTime(),
                        CancelEmpId = c.Int(),
                        AnnounceDate = c.DateTime(),
                        ReceiveDateStart = c.DateTime(),
                        ReceiveDateEnd = c.DateTime(),
                        BuildingDate = c.DateTime(),
                        ExplainDate = c.DateTime(),
                        OfferDateStart = c.DateTime(),
                        OfferDateEnd = c.DateTime(),
                        DiscloseDate = c.DateTime(),
                        ReceiveTimeStart = c.Time(),
                        ReceiveTimeEnd = c.Time(),
                        BuildingTimeStart = c.Time(),
                        BuildingTimeEnd = c.Time(),
                        ExplainTime = c.Time(),
                        OfferTimeStart = c.Time(),
                        OfferTimeEnd = c.Time(),
                        DiscloseTime = c.Time(),
                        ReceivePlace = c.String(),
                        OfferPlace = c.String(),
                        DisclosePlace = c.String(),
                        ReceiveType = c.String(),
                        DocumentAmount = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        ApprovedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BidId);
            
            CreateTable(
                "dbo.IcmBidder",
                c => new
                    {
                        BidderId = c.Int(nullable: false, identity: true),
                        ConId = c.Int(nullable: false),
                        BidId = c.Int(),
                        PrId = c.Int(),
                        ReceiveDate = c.DateTime(),
                        ReceiptNo = c.String(),
                        OfferDate = c.DateTime(),
                        BidderDate = c.DateTime(),
                        DueDate = c.DateTime(),
                        DueDay = c.Int(),
                        DurTypeId = c.Int(),
                        VatPercent = c.Double(),
                        VatTypeId = c.Int(),
                        ReceiveStatus = c.String(),
                        OfferStatus = c.String(),
                        WinnerStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BidderId);
            
            CreateTable(
                "dbo.IcmBidderQuotation",
                c => new
                    {
                        BidderQuoId = c.Int(nullable: false, identity: true),
                        BidderId = c.Int(),
                        PrItemId = c.Int(),
                        Descr = c.String(),
                        Qty = c.Int(),
                        Price = c.Decimal(precision: 18, scale: 2),
                        ExcludeVatAmount = c.Decimal(precision: 18, scale: 2),
                        VatAmount = c.Decimal(precision: 18, scale: 2),
                        DiscountPercent = c.Decimal(precision: 18, scale: 2),
                        ExtraDiscount = c.Decimal(precision: 18, scale: 2),
                        NetAmount = c.Decimal(precision: 18, scale: 2),
                        Remarks = c.String(),
                        Selected = c.String(),
                        SelectedReason = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BidderQuoId);
            
            CreateTable(
                "dbo.IcmPurchaseOrderInstallmentItem",
                c => new
                    {
                        PoInstallItemId = c.Int(nullable: false, identity: true),
                        PoInstallId = c.Int(nullable: false),
                        BidderQuoId = c.Int(nullable: false),
                        Descr = c.String(),
                        Qty = c.Int(),
                        ItemPriceExcludeVat = c.Double(),
                        ItemPriceIncludeVat = c.Double(),
                        ExcludeVatAmount = c.Double(),
                        VatAmount = c.Double(),
                        NetAmount = c.Double(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PoInstallItemId);
            
            CreateTable(
                "dbo.IcmMasPurchaseMethod",
                c => new
                    {
                        PcMethodId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Descr = c.String(),
                        Reason = c.String(),
                        PcTypeId = c.Int(nullable: false),
                        IsBid = c.Boolean(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PcMethodId);
            
            CreateTable(
                "dbo.IcmPurchaseRequest",
                c => new
                    {
                        PrId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        Reason = c.String(),
                        Remark = c.String(),
                        RegularId = c.Int(),
                        PriorityId = c.Int(),
                        PcTypeId = c.Int(),
                        PcMethodId = c.Int(),
                        PcMethodReason = c.String(),
                        YearTypeId = c.Int(),
                        BgYear = c.Int(),
                        PurchaseDate = c.DateTime(),
                        PurchaseEmpId = c.Int(),
                        PurchaseJobSiteId = c.Int(),
                        ConfirmDate = c.DateTime(),
                        ConfirmEmpId = c.Int(),
                        CancelDate = c.DateTime(),
                        CancelEmpId = c.Int(),
                        RequireDate = c.DateTime(),
                        RequireDuration = c.Int(),
                        DurTypeId = c.Int(),
                        DurCountId = c.Int(),
                        ProgressId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PrId);
            
            CreateTable(
                "dbo.IcmPurchaseRequestItem",
                c => new
                    {
                        PrItemId = c.Int(nullable: false, identity: true),
                        BgExpId = c.Int(nullable: false),
                        PrId = c.Int(),
                        ResItemId = c.Int(),
                        Descr = c.String(),
                        OriQty = c.Int(),
                        MinPrice = c.Decimal(precision: 18, scale: 2),
                        MaxPrice = c.Decimal(precision: 18, scale: 2),
                        StdPrice = c.Decimal(precision: 18, scale: 2),
                        Qty = c.Int(),
                        Price = c.Decimal(precision: 18, scale: 2),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        RecordStatus = c.String(),
                    })
                .PrimaryKey(t => t.PrItemId);
            
            CreateTable(
                "dbo.IcmMasPurchaseType",
                c => new
                    {
                        PcTypeId = c.Int(nullable: false, identity: true),
                        PcTypeName = c.String(),
                        PcTypeDescr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        RestoredBy = c.Int(),
                        RestoredWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PcTypeId);
            
            CreateTable(
                "dbo.IcmPrePurchaseRequest",
                c => new
                    {
                        PprId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(nullable: false),
                        Reason = c.String(),
                        PriorityId = c.Int(nullable: false),
                        PcTypeId = c.Int(nullable: false),
                        YearTypeId = c.Int(nullable: false),
                        BgYear = c.Int(nullable: false),
                        RequestDate = c.DateTime(nullable: false),
                        RequestEmpId = c.Int(nullable: false),
                        RequestJobSiteId = c.Int(nullable: false),
                        RequireDate = c.DateTime(),
                        RequireDuration = c.Int(),
                        DurTypeId = c.Int(),
                        DurCountId = c.Int(),
                        ProgressId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PprId);
            
            CreateTable(
                "dbo.IcmMasPurchaseRegular",
                c => new
                    {
                        RegularId = c.Int(nullable: false, identity: true),
                        Name = c.String(nullable: false),
                        Description = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.RegularId);
            
            CreateTable(
                "dbo.IcmPrePurchaseRequestItem",
                c => new
                    {
                        PprItemId = c.Int(nullable: false, identity: true),
                        PprId = c.Int(nullable: false),
                        ProjOperExpId = c.Int(),
                        BgExpId = c.Int(),
                        BgSourceId = c.Int(),
                        RegularId = c.Int(),
                        ResItemId = c.Int(),
                        PrItemId = c.Int(),
                        Descr = c.String(),
                        Qty = c.Int(),
                        Price = c.Decimal(precision: 18, scale: 2),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        StdPrice = c.Decimal(precision: 18, scale: 2),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PprItemId);
            
            CreateTable(
                "dbo.bgm_project_operation_report",
                c => new
                    {
                        bgm_proj_oper_rpt_seq = c.Int(nullable: false, identity: true),
                        descr = c.String(storeType: "ntext"),
                        bgm_proj_oper_exp_seq = c.Int(),
                        icm_ppr_item_seq = c.Int(),
                        icm_pr_item_seq = c.Int(),
                        icm_po_install_item_seq = c.Int(),
                        icm_dn_item_seq = c.Int(),
                        money_req_dtls_seq = c.Int(),
                        return_dtls_seq = c.Int(),
                        petition_dtls_seq = c.Int(),
                        pay_seq = c.Int(),
                        used_amount = c.Decimal(precision: 18, scale: 2),
                        cal_amount = c.Decimal(precision: 18, scale: 2),
                        rpt_type = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_oper_rpt_seq);
            
            CreateTable(
                "dbo.IcmMasLookUpType",
                c => new
                    {
                        LookUpTypeId = c.Int(nullable: false, identity: true),
                        LookUpTypeName = c.String(),
                        Description = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.LookUpTypeId);
            
            CreateTable(
                "dbo.IcmMasLookUp",
                c => new
                    {
                        LookUpId = c.Int(nullable: false, identity: true),
                        LookUpTypeId = c.Int(nullable: false),
                        LookUpName = c.String(),
                        Description = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.LookUpId);
            
            CreateTable(
                "dbo.IcmMasContact",
                c => new
                    {
                        ConId = c.Int(nullable: false, identity: true),
                        NameTh = c.String(nullable: false),
                        NameEng = c.String(),
                        ConCategory = c.Int(nullable: false),
                        ConGrpId = c.Int(nullable: false),
                        TaxCode = c.String(),
                        RegistedDate = c.DateTime(),
                        RegistedCapital = c.Decimal(precision: 18, scale: 2),
                        GfmisCode = c.String(),
                        Coordinator = c.String(),
                        VatTypeId = c.Int(),
                        ConStatusId = c.Int(),
                        StatRemarks = c.String(),
                        Country = c.String(),
                        Building = c.String(),
                        Floor = c.String(),
                        Village = c.String(),
                        Address = c.String(),
                        Road = c.String(),
                        Lane = c.String(),
                        District = c.String(),
                        Amphur = c.String(),
                        Postal = c.String(),
                        Province = c.String(),
                        Tel = c.String(),
                        TelNext = c.String(),
                        Fax = c.String(),
                        FaxNext = c.String(),
                        Email = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ConId);
            
            CreateTable(
                "dbo.bgm_project_operation_person",
                c => new
                    {
                        bgm_proj_oper_per_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_oper_seq = c.Int(),
                        emp_seq = c.Int(),
                        ContactId = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_oper_per_seq);
            
            CreateTable(
                "dbo.bgm_project_operation",
                c => new
                    {
                        bgm_proj_oper_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_oper_code = c.String(storeType: "ntext"),
                        bgm_proj_oper_name = c.String(storeType: "ntext"),
                        bgm_proj_oper_descr = c.String(storeType: "ntext"),
                        bgm_proj_oper_date = c.DateTime(storeType: "datetime2"),
                        start_date = c.DateTime(storeType: "datetime2"),
                        end_date = c.DateTime(storeType: "datetime2"),
                        attend_count = c.Int(),
                        bgm_proj_seq = c.Int(),
                        emp_seq = c.Int(),
                        job_site_seq = c.Int(),
                        is_use = c.String(storeType: "ntext"),
                        work_place = c.String(storeType: "ntext"),
                        bgm_year = c.Int(),
                        scope = c.String(storeType: "ntext"),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_oper_seq);
            
            CreateTable(
                "dbo.bgm_project_operation_expense",
                c => new
                    {
                        bgm_proj_oper_exp_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_oper_seq = c.Int(),
                        bgm_proj_oper_descr = c.String(storeType: "ntext"),
                        bgm_proj_exp_seq = c.Int(),
                        amount = c.Decimal(precision: 18, scale: 2),
                        unit_price = c.Decimal(precision: 18, scale: 2),
                        unit_qty = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_oper_exp_seq);
            
            CreateTable(
                "dbo.bgm_project_report",
                c => new
                    {
                        bgm_proj_rpt_seq = c.Int(nullable: false, identity: true),
                        descr = c.String(storeType: "ntext"),
                        bgm_proj_exp_seq = c.Int(),
                        bgm_proj_oper_exp_seq = c.Int(),
                        used_amount = c.Decimal(precision: 18, scale: 2),
                        cal_amount = c.Decimal(precision: 18, scale: 2),
                        rpt_type = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_rpt_seq);
            
            CreateTable(
                "dbo.bgm_system_option_type",
                c => new
                    {
                        bgm_option_type_seq = c.Int(nullable: false, identity: true),
                        bgm_option_type_name = c.String(storeType: "ntext"),
                        has_child = c.Int(),
                        label_name = c.String(storeType: "ntext"),
                        has_jobsite = c.Int(),
                        has_description = c.Int(),
                        label_header = c.String(storeType: "ntext"),
                        record_status = c.String(storeType: "ntext"),
                    })
                .PrimaryKey(t => t.bgm_option_type_seq);
            
            CreateTable(
                "dbo.bgm_mas_option",
                c => new
                    {
                        bgm_option_seq = c.Int(nullable: false, identity: true),
                        bgm_option_code = c.String(storeType: "ntext"),
                        bgm_option_name = c.String(storeType: "ntext"),
                        bgm_option_descr = c.String(storeType: "ntext"),
                        upper_bgm_option_seq = c.Int(),
                        job_site_seq = c.Int(),
                        bgm_option_type_seq = c.Int(),
                        bgm_year = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_option_seq);
            
            CreateTable(
                "dbo.bgm_project_option",
                c => new
                    {
                        bgm_proj_opt_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_seq = c.Int(),
                        descr = c.String(storeType: "ntext"),
                        weight = c.Decimal(precision: 18, scale: 2),
                        bgm_option_seq = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_opt_seq);
            
            CreateTable(
                "dbo.bgm_project_manager",
                c => new
                    {
                        bgm_proj_mng_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_seq = c.Int(),
                        emp_seq = c.Int(),
                    })
                .PrimaryKey(t => t.bgm_proj_mng_seq);
            
            CreateTable(
                "dbo.bgm_project_activity_plan",
                c => new
                    {
                        bgm_proj_act_plan_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_seq = c.Int(),
                        descr = c.String(storeType: "ntext"),
                        act_month1 = c.Int(),
                        act_month2 = c.Int(),
                        act_month3 = c.Int(),
                        act_month4 = c.Int(),
                        act_month5 = c.Int(),
                        act_month6 = c.Int(),
                        act_month7 = c.Int(),
                        act_month8 = c.Int(),
                        act_month9 = c.Int(),
                        act_month10 = c.Int(),
                        act_month11 = c.Int(),
                        act_month12 = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_act_plan_seq);
            
            CreateTable(
                "dbo.IcmMasUnit",
                c => new
                    {
                        UnitId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(nullable: false),
                        Sign = c.String(),
                        Descr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.UnitId);
            
            CreateTable(
                "dbo.IcmMasDepreciationType",
                c => new
                    {
                        DpTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(nullable: false),
                        ScrapValue = c.Decimal(nullable: false, precision: 18, scale: 2),
                        DpRateYear = c.Decimal(nullable: false, precision: 18, scale: 2),
                        MinRateYear = c.Decimal(nullable: false, precision: 18, scale: 2),
                        MaxRateYear = c.Decimal(nullable: false, precision: 18, scale: 2),
                        MinLifeYear = c.Int(nullable: false),
                        MaxLifeYear = c.Int(nullable: false),
                        RecordStatus = c.String(maxLength: 2),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DpTypeId);
            
            CreateTable(
                "dbo.IcmMasResourceType",
                c => new
                    {
                        ResTypeId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        Descr = c.String(),
                        DepreciationCalculate = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ResTypeId);
            
            CreateTable(
                "dbo.IcmMasResourceGroup",
                c => new
                    {
                        ResGrpId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        OldCode = c.String(),
                        Name = c.String(),
                        Descr = c.String(),
                        ResTypeId = c.Int(),
                        MinPriceCalDepreciation = c.Double(),
                        DpTypeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        AssetAccountId = c.Int(),
                        CumdepreAccountId = c.Int(),
                        DepreAccountId = c.Int(),
                        BreakAccountId = c.Int(),
                        ConsumeAccountId = c.Int(),
                    })
                .PrimaryKey(t => t.ResGrpId);
            
            CreateTable(
                "dbo.IcmMasResourceSubGroup",
                c => new
                    {
                        ResSubGrpId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        OldCode = c.String(),
                        Name = c.String(),
                        Descr = c.String(),
                        ResGrpId = c.Int(),
                        UnspscCode = c.String(),
                        IncCode = c.String(),
                        DpTypeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ResSubGrpId);
            
            CreateTable(
                "dbo.IcmMasResourceItem",
                c => new
                    {
                        ResItemId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        OldCode = c.String(),
                        Name = c.String(),
                        Descr = c.String(),
                        ResSubGrpId = c.Int(),
                        GpscCode = c.String(),
                        GiinCode = c.String(),
                        StdPrice = c.Double(),
                        MinPrice = c.Double(),
                        MaxPrice = c.Double(),
                        UnitId = c.Int(),
                        MinQty = c.Int(),
                        MaxQty = c.Int(),
                        ImageName = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ResItemId);
            
            CreateTable(
                "dbo.bgm_project_expense",
                c => new
                    {
                        bgm_proj_exp_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_seq = c.Int(),
                        descr = c.String(storeType: "ntext"),
                        total_amount = c.Decimal(precision: 18, scale: 2),
                        total_amount_out_plan = c.Decimal(precision: 18, scale: 2),
                        remark = c.String(storeType: "ntext"),
                        mtef1 = c.Decimal(precision: 18, scale: 2),
                        mtef2 = c.Decimal(precision: 18, scale: 2),
                        mtef3 = c.Decimal(precision: 18, scale: 2),
                        bgm_source_seq = c.Int(),
                        bgm_exp_seq = c.Int(),
                        icm_res_item_seq = c.Int(),
                        unit_price = c.Decimal(precision: 18, scale: 2),
                        unit_qty = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_exp_seq);
            
            CreateTable(
                "dbo.bgm_project",
                c => new
                    {
                        bgm_proj_seq = c.Int(nullable: false, identity: true),
                        bgm_proj_code = c.String(storeType: "ntext"),
                        bgm_proj_name = c.String(storeType: "ntext"),
                        bgm_proj_descr = c.String(storeType: "ntext"),
                        bgm_proj_manager = c.Int(),
                        bgm_proj_scope = c.Int(),
                        bgm_proj_date = c.DateTime(storeType: "datetime2"),
                        bgm_proj_reason = c.String(storeType: "ntext"),
                        bgm_proj_object = c.String(storeType: "ntext"),
                        bgm_proj_target = c.String(storeType: "ntext"),
                        bgm_proj_plan = c.String(storeType: "ntext"),
                        bgm_proj_remark = c.String(storeType: "ntext"),
                        bgm_strat_list_seq = c.Int(),
                        prj_type_seq = c.Int(),
                        job_site_seq = c.Int(),
                        job_site_seq_main = c.Int(),
                        bgm_year = c.Int(),
                        date_start = c.DateTime(storeType: "datetime2"),
                        date_end = c.DateTime(storeType: "datetime2"),
                        gfmis_code = c.String(storeType: "ntext"),
                        alt_proj_seq = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_proj_seq);
            
            CreateTable(
                "dbo.bgm_mas_expense_source",
                c => new
                    {
                        bgm_exp_source_seq = c.Int(nullable: false, identity: true),
                        bgm_exp_seq = c.Int(),
                        bgm_source_seq = c.Int(),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_exp_source_seq);
            
            CreateTable(
                "dbo.bgm_mas_expense_group",
                c => new
                    {
                        bgm_exp_grp_seq = c.Int(nullable: false, identity: true),
                        bgm_exp_grp_code = c.String(storeType: "ntext"),
                        bgm_exp_grp_name = c.String(storeType: "ntext"),
                        bgm_exp_grp_descr = c.String(storeType: "ntext"),
                        bgm_exp_grp_x = c.Int(),
                        bgm_source_seq = c.Int(),
                        gfmis_code = c.String(storeType: "ntext"),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_exp_grp_seq);
            
            CreateTable(
                "dbo.bgm_mas_expense",
                c => new
                    {
                        bgm_exp_seq = c.Int(nullable: false, identity: true),
                        bgm_exp_code = c.String(storeType: "ntext"),
                        bgm_exp_name = c.String(storeType: "ntext"),
                        bgm_exp_descr = c.String(storeType: "ntext"),
                        upper_bgm_exp_seq = c.Int(),
                        bgm_exp_grp_seq = c.Int(),
                        bgm_exp_grp_id_real = c.Int(),
                        account_seq = c.Int(),
                        icm_resource_seq = c.Int(),
                        icm_resource_type = c.String(storeType: "ntext"),
                        gfmis_code = c.String(storeType: "ntext"),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_exp_seq);
            
            CreateTable(
                "dbo.AcmTransectionGroup",
                c => new
                    {
                        TranGrpId = c.Int(nullable: false, identity: true),
                        TranGrpCode = c.String(),
                        RefType = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TranGrpId);
            
            CreateTable(
                "dbo.AcmTransectionDtl",
                c => new
                    {
                        TranDtlsId = c.Int(nullable: false, identity: true),
                        TranId = c.Int(),
                        AccountId = c.Int(),
                        DrOrCr = c.String(),
                        Amount = c.Double(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TranDtlsId);
            
            CreateTable(
                "dbo.HrmMasMaritalStatus",
                c => new
                    {
                        MarStatusId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.MarStatusId);
            
            CreateTable(
                "dbo.HrmMasEmployeeStatus",
                c => new
                    {
                        EmpStatusId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        Active = c.Boolean(nullable: false),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpStatusId);
            
            CreateTable(
                "dbo.HrmMasPositionStatus",
                c => new
                    {
                        PosStatusId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PosStatusId);
            
            CreateTable(
                "dbo.HrmExecutivePosition",
                c => new
                    {
                        ExecPosId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        NameShort = c.String(),
                        NameEngShort = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ExecPosId);
            
            CreateTable(
                "dbo.HrmFieldPosition",
                c => new
                    {
                        FieldPosId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        EmpTypeId = c.Int(),
                        PosTypeId = c.Int(),
                        FieldGroupId = c.Int(),
                        ClassSpecId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FieldPosId);
            
            CreateTable(
                "dbo.HrmMasJobSiteStatus",
                c => new
                    {
                        JobSiteStatusId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.JobSiteStatusId);
            
            CreateTable(
                "dbo.HrmMasCountry",
                c => new
                    {
                        CountryId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CountryId);
            
            CreateTable(
                "dbo.HrmMasCity",
                c => new
                    {
                        CityId = c.Int(nullable: false, identity: true),
                        CountryId = c.Int(),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.CityId);
            
            CreateTable(
                "dbo.HrmMasProvince",
                c => new
                    {
                        ProvinceId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ProvinceId);
            
            CreateTable(
                "dbo.HrmMasAmphur",
                c => new
                    {
                        AmphurId = c.Int(nullable: false, identity: true),
                        ProvinceId = c.Int(),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AmphurId);
            
            CreateTable(
                "dbo.HrmMasDistrict",
                c => new
                    {
                        DistrictId = c.Int(nullable: false, identity: true),
                        AmphurId = c.Int(),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.DistrictId);
            
            CreateTable(
                "dbo.HrmMasJobSiteLevel",
                c => new
                    {
                        JobSiteLevelId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                    })
                .PrimaryKey(t => t.JobSiteLevelId);
            
            CreateTable(
                "dbo.HrmMasJobSiteType",
                c => new
                    {
                        JobSiteTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        CurrentJobSiteId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.JobSiteTypeId);
            
            CreateTable(
                "dbo.HrmJobSite",
                c => new
                    {
                        JobSiteId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        NameShort = c.String(),
                        NameEng = c.String(),
                        NameEngShort = c.String(),
                        GfmisCode = c.String(),
                        UpperJobSiteId = c.Int(),
                        FullPath = c.String(),
                        RefJobSiteId = c.Int(),
                        JobSiteTypeId = c.Int(),
                        WorkAreaId = c.Int(),
                        JobSiteLevelId = c.Int(),
                        HeaderPosId = c.Int(),
                        Address = c.String(),
                        DistrictId = c.Int(),
                        ProvnceId = c.Int(),
                        CityId = c.Int(),
                        CountryId = c.Int(),
                        PostalCode = c.String(),
                        Tel = c.String(),
                        Fax = c.String(),
                        WebAddress = c.String(),
                        JobSiteStatusId = c.Int(),
                        JobDescription = c.String(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        JobSite_JobSiteId = c.Int(),
                        MpJobSiteType_JobSiteTypeId = c.Int(),
                    })
                .PrimaryKey(t => t.JobSiteId);
            
            CreateTable(
                "dbo.HrmPosition",
                c => new
                    {
                        PosId = c.Int(nullable: false, identity: true),
                        PosNo = c.Int(),
                        Name = c.String(),
                        UpperPosId = c.Int(),
                        WorkingUpperPosId = c.Int(),
                        JobSiteId = c.Int(),
                        FieldPosId = c.Int(),
                        ExecPosId = c.Int(),
                        EmpTypeId = c.Int(),
                        DefinedDate = c.DateTime(),
                        MoneySupportDate = c.DateTime(),
                        SalaryQuota = c.Decimal(precision: 18, scale: 2),
                        SalaryMin = c.Decimal(precision: 18, scale: 2),
                        SalaryMax = c.Decimal(precision: 18, scale: 2),
                        PosExecSalary = c.Decimal(precision: 18, scale: 2),
                        JobDescription = c.String(),
                        PosStatusId = c.Int(nullable: false),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        Position_PosId = c.Int(),
                        Position_PosId1 = c.Int(),
                    })
                .PrimaryKey(t => t.PosId);
            
            CreateTable(
                "dbo.HrmMasPositionType",
                c => new
                    {
                        PosTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        NameShort = c.String(),
                        NameEng = c.String(),
                        NameEngShort = c.String(),
                        EmpTypeId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.PosTypeId);
            
            CreateTable(
                "dbo.HrmMasClass",
                c => new
                    {
                        ClassId = c.Int(nullable: false, identity: true),
                        ClassNo = c.String(),
                        Name = c.String(),
                        NameShort = c.String(),
                        NameEng = c.String(),
                        NameEngShort = c.String(),
                        PosTypeId = c.Int(nullable: false),
                        EmpTypeId = c.Int(nullable: false),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ClassId);
            
            CreateTable(
                "dbo.HrmMasEmployeeType",
                c => new
                    {
                        EmpTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        SalaryUpTime = c.Int(),
                        AgeRetirement = c.Int(),
                        YearTypeId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpTypeId);
            
            CreateTable(
                "dbo.HrmMasNationality",
                c => new
                    {
                        NatId = c.Int(nullable: false, identity: true),
                        NatName = c.Int(nullable: false),
                        NatNameEng = c.Int(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.NatId);
            
            CreateTable(
                "dbo.HrmMasReligion",
                c => new
                    {
                        ReligionId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.ReligionId);
            
            CreateTable(
                "dbo.HrmMasGender",
                c => new
                    {
                        GenderId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        NameEng = c.String(),
                        Thai = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.GenderId);
            
            CreateTable(
                "dbo.HrmMasNamePrefix",
                c => new
                    {
                        NamePrefixId = c.Int(nullable: false, identity: true),
                        GenderId = c.Int(),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        NameShort = c.String(),
                        NameEngShort = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.NamePrefixId);
            
            CreateTable(
                "dbo.HrmEmployee",
                c => new
                    {
                        EmpId = c.Int(nullable: false, identity: true),
                        GenderId = c.Int(nullable: false),
                        NamePrefixId = c.Int(nullable: false),
                        FirstName = c.String(nullable: false),
                        LastName = c.String(nullable: false),
                        FirstNameEng = c.String(),
                        LastNameEng = c.String(),
                        NickName = c.String(),
                        ReligionId = c.Int(),
                        RaceNationalId = c.Int(),
                        NationalId = c.Int(),
                        BirthDate = c.DateTime(nullable: false),
                        BloodGroup = c.String(),
                        Citizen = c.String(nullable: false, maxLength: 13),
                        TaxPayer = c.String(maxLength: 13),
                        Social = c.String(maxLength: 13),
                        Official = c.String(maxLength: 13),
                        EmpTypeId = c.Int(),
                        ClassId = c.Int(),
                        SalaryLevelId = c.Int(),
                        Salary = c.Decimal(precision: 18, scale: 2),
                        PosId = c.Int(),
                        ExecPosId = c.Int(),
                        WorkingJobSiteId = c.Int(),
                        AdmittedDate = c.DateTime(),
                        WorkStartDate = c.DateTime(),
                        QuitDate = c.DateTime(),
                        ProbationEndDate = c.DateTime(),
                        DeathDate = c.DateTime(),
                        LatestPositionDate = c.DateTime(),
                        LatestClassDate = c.DateTime(),
                        LatestWorkingJobSiteDate = c.DateTime(),
                        MaritalStatusId = c.Int(),
                        ImageUnique = c.String(),
                        EmpStatusId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.EmpId);
            
            CreateTable(
                "dbo.FimMasLookUpType",
                c => new
                    {
                        LookUpTypeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Descr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.LookUpTypeId);
            
            CreateTable(
                "dbo.FimMasLookUp",
                c => new
                    {
                        LookUpId = c.Int(nullable: false, identity: true),
                        LookUpTypeId = c.Int(nullable: false),
                        Name = c.String(),
                        Descr = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(nullable: false),
                        CreatedWhen = c.DateTime(nullable: false),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.LookUpId);
            
            CreateTable(
                "dbo.FimMasBank",
                c => new
                    {
                        BankId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BankId);
            
            CreateTable(
                "dbo.FimMasBankBranch",
                c => new
                    {
                        BranchId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        BranchName = c.String(),
                        BranchNameEng = c.String(),
                        BankId = c.Int(nullable: false),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BranchId);
            
            CreateTable(
                "dbo.FimMasBankAccount",
                c => new
                    {
                        BankAccId = c.Int(nullable: false, identity: true),
                        BankAccNo = c.String(),
                        Name = c.String(),
                        NameEng = c.String(),
                        BankAccTypeId = c.Int(),
                        BranchId = c.Int(),
                        BgmSourceId = c.Int(),
                        SavingBankAccId = c.Int(),
                        AccountId = c.Int(),
                        WorkAreaId = c.Int(),
                        Remarks = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.BankAccId);
            
            CreateTable(
                "dbo.HrmMasScope",
                c => new
                    {
                        ScopeId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                        MasScope_ScopeId = c.Int(),
                    })
                .PrimaryKey(t => t.ScopeId);
            
            CreateTable(
                "dbo.HrmMasWorkArea",
                c => new
                    {
                        WorkAreaId = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        ScopeId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.WorkAreaId);
            
            CreateTable(
                "dbo.SysYearType",
                c => new
                    {
                        YearTypeId = c.Int(nullable: false, identity: true),
                        YearTypeName = c.String(),
                        YearTypeDescr = c.String(),
                        MonthStart = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.YearTypeId);
            
            CreateTable(
                "dbo.bgm_mas_source_type",
                c => new
                    {
                        bgm_source_type_seq = c.Int(nullable: false, identity: true),
                        bgm_source_type_code = c.String(storeType: "ntext"),
                        bgm_source_type_name = c.String(storeType: "ntext"),
                        bgm_source_type_descr = c.String(storeType: "ntext"),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_source_type_seq);
            
            CreateTable(
                "dbo.bgm_mas_source",
                c => new
                    {
                        bgm_source_seq = c.Int(nullable: false, identity: true),
                        bgm_source_code = c.String(storeType: "ntext"),
                        gfmis_code = c.String(storeType: "ntext"),
                        bgm_source_name = c.String(storeType: "ntext"),
                        bgm_source_descr = c.String(storeType: "ntext"),
                        upper_bgm_source_seq = c.Int(),
                        bgm_source_type_seq = c.Int(),
                        bgm_year_type_seq = c.Int(),
                        use_petition = c.Boolean(nullable: false),
                        use_request = c.Boolean(nullable: false),
                        record_status = c.String(storeType: "ntext"),
                        created_by = c.Int(),
                        created_when = c.DateTime(storeType: "datetime2"),
                        updated_by = c.Int(),
                        updated_when = c.DateTime(storeType: "datetime2"),
                    })
                .PrimaryKey(t => t.bgm_source_seq);
            
            CreateTable(
                "dbo.FimTransfer",
                c => new
                    {
                        TransferId = c.Int(nullable: false, identity: true),
                        BgSourceId = c.Int(nullable: false),
                        WorkAreaId = c.Int(nullable: false),
                        BgYear = c.Int(nullable: false),
                        TransferType = c.String(),
                        TransferName = c.String(),
                        RefNo = c.String(),
                        TransferDate = c.DateTime(),
                        FromBankAccId = c.Int(),
                        ToBankAccId = c.Int(),
                        Amount = c.Decimal(precision: 18, scale: 2),
                        EmpId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TransferId);
            
            CreateTable(
                "dbo.AcmTransection",
                c => new
                    {
                        TranId = c.Int(nullable: false, identity: true),
                        TranType = c.String(),
                        FiscalPeriod = c.String(),
                        TransferId = c.Int(),
                        TranCode = c.String(),
                        TranDate = c.DateTime(),
                        BgYear = c.Int(),
                        WorkAreaId = c.Int(),
                        BgSourceId = c.Int(),
                        RefNo = c.String(),
                        TranName = c.String(),
                        Remarks = c.String(),
                        ApprovedBy = c.Int(),
                        ApprovedWhen = c.DateTime(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.TranId);
            
            CreateTable(
                "dbo.AcmMasFiscalPeriod",
                c => new
                    {
                        FiscalPeriod = c.Int(nullable: false, identity: true),
                        FiscalPeriodCode = c.String(),
                        FiscalPeriodName = c.String(),
                        FiscalPeriodRemark = c.String(),
                        FiscalStartDate = c.DateTime(),
                        FiscalEndDate = c.DateTime(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.FiscalPeriod);
            
            CreateTable(
                "dbo.AcmMasBaseAccount",
                c => new
                    {
                        CashAccountId = c.Int(nullable: false, identity: true),
                        DnCrAccount = c.Int(),
                        LoadAccountId = c.Int(),
                        TaxAccountId = c.Int(),
                        RemainAccountId = c.Int(),
                        PenaltyAccountId = c.Int(),
                        OverAccountId = c.Int(),
                        DirectPayAccountId = c.Int(),
                        IncomeBbAccountId = c.Int(),
                        WaitIncomeBbAccountId = c.Int(),
                        RedemptionAccountId = c.Int(),
                        CollateralAccountId1 = c.Int(),
                        CollateralAccountId2 = c.Int(),
                        CollateralAccountId3 = c.Int(),
                        CollateralAccountId4 = c.Int(),
                        PayIncomeAccountId = c.Int(),
                        GovIncomeAccountId = c.Int(),
                        GovDepositAccountId = c.Int(),
                        WaitAccountId = c.Int(),
                        UpdatedBy = c.Int(),
                        CreatedBy = c.DateTime(),
                    })
                .PrimaryKey(t => t.CashAccountId);
            
            CreateTable(
                "dbo.AcmMasAccounts",
                c => new
                    {
                        GlAccId = c.Long(nullable: false, identity: true),
                        GlAccId2 = c.String(),
                        GlAccName = c.String(),
                        GlUpperAccId = c.Int(),
                        RecordStatus = c.String(),
                    })
                .PrimaryKey(t => t.GlAccId);
            
            CreateTable(
                "dbo.AcmMasAccountVersion",
                c => new
                    {
                        VersionId = c.Int(nullable: false, identity: true),
                        VersionNo = c.String(),
                        VersionDescr = c.String(),
                        UseFlag = c.Boolean(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.VersionId);
            
            CreateTable(
                "dbo.AcmMasAccount",
                c => new
                    {
                        AccountId = c.Int(nullable: false, identity: true),
                        AccountCode = c.String(),
                        UpperAccountId = c.Int(),
                        AccountName = c.String(),
                        AccountDescr = c.String(),
                        VersionId = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AccountId);
            
            CreateTable(
                "dbo.AcmChangeValue",
                c => new
                    {
                        AccountChangeId = c.Int(nullable: false, identity: true),
                        AccountCash = c.Int(),
                        AccountCreditorFromCheckReceive = c.Int(),
                        AccountDebtorBorrowCash = c.Int(),
                        AccountWhtTax = c.Int(),
                        AccountVoucherRemainPay = c.Int(),
                        AccountPayBetweenOrg = c.Int(),
                        AccountIncomeBetweenOrg = c.Int(),
                        AccountFineFromCheck = c.Int(),
                        AccountGuranteeResult = c.Int(),
                        AccountWaitReceiveCash = c.Int(),
                        AccountRequestMoneyMoreWaitReturn = c.Int(),
                        AccountGuaranteeEnvelope = c.Int(),
                        AccountGuaranteePromise = c.Int(),
                        AccountGuaranteePayAdvance = c.Int(),
                        AccountSendIncome = c.Int(),
                        AccountIncomeWaitSendStock = c.Int(),
                        AccountCashDepositStock = c.Int(),
                        AccountRemainReceiveOrgAccCenter = c.Int(),
                        LengthAccountCode = c.Int(),
                        RecordStatus = c.String(),
                        CreatedBy = c.Int(),
                        CreatedWhen = c.DateTime(),
                        UpdatedBy = c.Int(),
                        UpdatedWhen = c.DateTime(),
                    })
                .PrimaryKey(t => t.AccountChangeId);
            
            CreateIndex("dbo.HrmActivityRequest", "EmpId");
            CreateIndex("dbo.HrmActivityRequest", "ActId");
            CreateIndex("dbo.HrmActivity", "CityId");
            CreateIndex("dbo.HrmActivity", "JobSiteId");
            CreateIndex("dbo.HrmActivity", "ActTypeId");
            CreateIndex("dbo.HrmActivity", "BgmProjOperId");
            CreateIndex("dbo.HrmPsAbsenceRule", "AbsenceTypeId");
            CreateIndex("dbo.HrmPsAbsenceRule", "EmpTypeId");
            CreateIndex("dbo.HrmPsAbsence", "EmpId");
            CreateIndex("dbo.HrmPsAbsence", "AbsenceTypeId");
            CreateIndex("dbo.bgm_request", "job_site_seq");
            CreateIndex("dbo.bgm_request", "prj_type_seq");
            CreateIndex("dbo.bgm_request", "bgm_strat_list_seq");
            CreateIndex("dbo.HrmEsMail", "ReqId");
            CreateIndex("dbo.HrmEsMail", "ReceiverId");
            CreateIndex("dbo.HrmEsMail", "SenderId");
            CreateIndex("dbo.HrmEsMail", "MailTypeId");
            CreateIndex("dbo.HrmEsResponse", "RespNextId");
            CreateIndex("dbo.HrmEsResponse", "MailId");
            CreateIndex("dbo.HrmAprAppraisal", "StdScoreId");
            CreateIndex("dbo.HrmAprAppraisal", "EmpTypeId");
            CreateIndex("dbo.HrmScholarshipRequest", "ScholarGroupId");
            CreateIndex("dbo.HrmScholarshipRequest", "ResponseTypeId");
            CreateIndex("dbo.HrmScholarshipRequest", "EduQualId");
            CreateIndex("dbo.HrmScholarshipRequest", "ApContactDistrictId");
            CreateIndex("dbo.HrmScholarshipRequest", "ApCitizenId");
            CreateIndex("dbo.HrmScholarshipRequest", "ApFhId");
            CreateIndex("dbo.HrmScholarshipRequest", "EduMajorId");
            CreateIndex("dbo.HrmScholarshipRequest", "EduInsId");
            CreateIndex("dbo.HrmScholarshipRequest", "ScholarId");
            CreateIndex("dbo.HrmScholarshipRequest", "EmpId");
            CreateIndex("dbo.HrmScholarshipGroupDtls", "ScholarId");
            CreateIndex("dbo.HrmScholarshipGroupDtls", "EduMajorId");
            CreateIndex("dbo.HrmScholarshipGroup", "ScholarId");
            CreateIndex("dbo.HrmScholarship", "CountryId");
            CreateIndex("dbo.HrmScholarship", "EduDegreeId");
            CreateIndex("dbo.HrmScholarship", "ScholarFundId");
            CreateIndex("dbo.HrmScholarship", "ScholarTypeId");
            CreateIndex("dbo.HrmTrainingSubjectDtls", "TrainingSubjectId");
            CreateIndex("dbo.HrmTrainer", "DistrictId");
            CreateIndex("dbo.HrmTrainer", "EmpId");
            CreateIndex("dbo.HrmTrainer", "NamePrefixId");
            CreateIndex("dbo.HrmTrainingCourseTrainer", "TrainingSubjectDtlsId");
            CreateIndex("dbo.HrmTrainingCourseTrainer", "TrainingSubjectId");
            CreateIndex("dbo.HrmTrainingCourseTrainer", "TrainerId");
            CreateIndex("dbo.HrmTrainingCourseTrainer", "TrainId");
            CreateIndex("dbo.HrmTrainingCourseQuota", "JobSiteId");
            CreateIndex("dbo.HrmTrainingCourseQuota", "TrainId");
            CreateIndex("dbo.HrmTrainingCourseTrainee", "JobSiteId");
            CreateIndex("dbo.HrmTrainingCourseTrainee", "EmpId");
            CreateIndex("dbo.HrmTrainingCourseTrainee", "TrainId");
            CreateIndex("dbo.HrmTrainingInstitute", "CountryId");
            CreateIndex("dbo.HrmScholarshipFund", "ScholarTypeId");
            CreateIndex("dbo.HrmTrainingType", "TrainingCatId");
            CreateIndex("dbo.HrmTrainingCurriculum", "TrainingTypeId");
            CreateIndex("dbo.HrmTrainingCourse", "BgSourceId");
            CreateIndex("dbo.HrmTrainingCourse", "TrainingGroupId");
            CreateIndex("dbo.HrmTrainingCourse", "CountryId");
            CreateIndex("dbo.HrmTrainingCourse", "TrainingInsId");
            CreateIndex("dbo.HrmTrainingCourse", "EpcId");
            CreateIndex("dbo.HrmTrainingCourse", "ScholarFundId");
            CreateIndex("dbo.HrmTrainingCourse", "EmpSecId");
            CreateIndex("dbo.HrmTrainingCourse", "TrainingCurId");
            CreateIndex("dbo.HrmTrainingRequest", "StatusId");
            CreateIndex("dbo.HrmTrainingRequest", "EmpId");
            CreateIndex("dbo.HrmPsTimeAttendant", "EmpId");
            CreateIndex("dbo.HrmPsEmpSpecialSkill", "SkillTypeId");
            CreateIndex("dbo.HrmPsEmpSpecialSkill", "EmpId");
            CreateIndex("dbo.HrmPsEmpSpecialExpert", "EmpId");
            CreateIndex("dbo.HrmScUser", "JobSiteId");
            CreateIndex("dbo.HrmScUser", "ScEmpId");
            CreateIndex("dbo.HrmPrSalaryGroup", "ClassId");
            CreateIndex("dbo.HrmPrSalaryGroup", "PosTypeId");
            CreateIndex("dbo.HrmPrSalaryGroup", "EmpTypeId");
            CreateIndex("dbo.HrmPsRoyalItemRepayDtls", "GenderId");
            CreateIndex("dbo.HrmPsRoyalItemRepayDtls", "RoyalItemId");
            CreateIndex("dbo.HrmPsRoyalItemRepayDtls", "RepayId");
            CreateIndex("dbo.HrmPsRoyalItemRequest", "JobSiteId");
            CreateIndex("dbo.HrmPsRoyalItemRequest", "ClassId");
            CreateIndex("dbo.HrmPsRoyalItemRequest", "PosId");
            CreateIndex("dbo.HrmPsRoyalItemRequest", "CurrRoyalItemId");
            CreateIndex("dbo.HrmPsRoyalItemRequest", "RoyalItemId");
            CreateIndex("dbo.HrmPsRoyalItemRequest", "EmpId");
            CreateIndex("dbo.HrmPsRoyalItemHistory", "RoyalItemId");
            CreateIndex("dbo.HrmPsRoyalItemHistory", "RoyalItemReqId");
            CreateIndex("dbo.HrmPsRoyalItemHistory", "EmpId");
            CreateIndex("dbo.HrmPsRoyalItem", "RoyalItemTypeId");
            CreateIndex("dbo.HrmPsRoyalItemControl", "RoyalItemId");
            CreateIndex("dbo.HrmPsRoyalItemControl", "EmpId");
            CreateIndex("dbo.HrmPsRetirementDtls", "EmpId");
            CreateIndex("dbo.HrmPsRetirementDtls", "RetireId");
            CreateIndex("dbo.HrmPsRetirement", "JobSiteId");
            CreateIndex("dbo.HrmPsRetirement", "EmpTypeId");
            CreateIndex("dbo.HrmRcCatalog", "EmpTypeId");
            CreateIndex("dbo.HrmPrExtraType", "ContactId");
            CreateIndex("dbo.HrmPrExtraType", "CmdTypeId");
            CreateIndex("dbo.HrmPrExtraType", "EmpTypeId");
            CreateIndex("dbo.HrmMpPositionDutyDtls", "PosDutyId");
            CreateIndex("dbo.HrmMpPositionDuty", "DutyId");
            CreateIndex("dbo.HrmMpPositionDuty", "PosId");
            CreateIndex("dbo.HrmPsNwdJobSite", "JobSiteId");
            CreateIndex("dbo.HrmPsNwdJobSite", "NonWorkingId");
            CreateIndex("dbo.MasRegion", "CountryId");
            CreateIndex("dbo.HrmPsEmpLegatee", "FamId");
            CreateIndex("dbo.HrmPsEmpLegatee", "NamePrefixId");
            CreateIndex("dbo.HrmPsEmpLegatee", "EmpId");
            CreateIndex("dbo.HrmMpJobSiteType", "CurrJobSiteId");
            CreateIndex("dbo.HrmMpJobSiteType", "current_HrmMpJobSites_JobSiteId");
            CreateIndex("dbo.HrmMpJobSiteCommandDtls", "ToJobSiteLevelId");
            CreateIndex("dbo.HrmMpJobSiteCommandDtls", "FromJobSiteLevelId");
            CreateIndex("dbo.HrmMpJobSiteCommandDtls", "ToUpperId");
            CreateIndex("dbo.HrmMpJobSiteCommandDtls", "FromUpperId");
            CreateIndex("dbo.HrmMpJobSiteCommandDtls", "JobSiteId");
            CreateIndex("dbo.HrmMpJobSiteCommandDtls", "JobSiteCmdId");
            CreateIndex("dbo.HrmMpJobSiteCommand", "JobSiteTypeId");
            CreateIndex("dbo.HrmMpJobSiteArea", "JobSiteId");
            CreateIndex("dbo.HrmPsEmpParent", "NamePrefixId");
            CreateIndex("dbo.HrmPsEmpParent", "EmpId");
            CreateIndex("dbo.HrmChgRequest", "EmpId");
            CreateIndex("dbo.HrmChgRequest", "ChgTypeId");
            CreateIndex("dbo.HrmChgSpouse", "NamePrefixId");
            CreateIndex("dbo.HrmChgSpouse", "SpouseId");
            CreateIndex("dbo.HrmChgSpouse", "ChgReqId");
            CreateIndex("dbo.HrmPsEmpChildren", "SpouseId");
            CreateIndex("dbo.HrmPsEmpChildren", "EduInsId");
            CreateIndex("dbo.HrmPsEmpChildren", "EduDegreeId");
            CreateIndex("dbo.HrmPsEmpChildren", "NamePrefixId");
            CreateIndex("dbo.HrmPsEmpChildren", "GenderId");
            CreateIndex("dbo.HrmPsEmpChildren", "EmpId");
            CreateIndex("dbo.HrmPsEmpChildren", "HrmPsEmployees_EmpId");
            CreateIndex("dbo.HrmPsEmpSpouse", "NamePrefixId");
            CreateIndex("dbo.HrmPsEmpSpouse", "EmpId");
            CreateIndex("dbo.HrmPsEmpMovment", "EmpTypeId");
            CreateIndex("dbo.HrmPsEmpSalaryHistory", "MoveId");
            CreateIndex("dbo.HrmPsEmpSalaryHistory", "JobSiteId");
            CreateIndex("dbo.HrmPsEmpSalaryHistory", "ClassId");
            CreateIndex("dbo.HrmPsEmpSalaryHistory", "EmpId");
            CreateIndex("dbo.HrmPsEmpNameHistory", "NewPrefixId");
            CreateIndex("dbo.HrmPsEmpNameHistory", "OldPrefixId");
            CreateIndex("dbo.HrmPsEmpNameHistory", "EmpId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "CmdTypeId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "MoveId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "JobSiteId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "ClassId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "CmdExecId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "CmdFieldId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "CmdJobSiteId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "CmdClassId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "CmdDtlsId");
            CreateIndex("dbo.HrmPsEmpPositionHistory", "EmpId");
            CreateIndex("dbo.HrmPsEmpIncreases", "EmpId");
            CreateIndex("dbo.HrmPsEmpGoodness", "EmpId");
            CreateIndex("dbo.HrmPsEmpEnglish", "EmpId");
            CreateIndex("dbo.HrmPsEmpEnglish", "HrmPsEmployees_EmpId");
            CreateIndex("dbo.HrmPsEmpEducation", "EduMajorId");
            CreateIndex("dbo.HrmPsEmpEducation", "EduInsId");
            CreateIndex("dbo.HrmPsEmpEducation", "EduQualId");
            CreateIndex("dbo.HrmPsEmpEducation", "EduDegreeId");
            CreateIndex("dbo.HrmPsEmpEducation", "EmpId");
            CreateIndex("dbo.HrmPsEmpEducation", "HrmPsEmployees_EmpId");
            CreateIndex("dbo.HrmMpFieldSpecification", "ClassId");
            CreateIndex("dbo.HrmMpFieldSpecification", "FieldPosId");
            CreateIndex("dbo.HrmMpFieldSpecificationDtls", "ClassId");
            CreateIndex("dbo.HrmMpFieldSpecificationDtls", "PosTypeId");
            CreateIndex("dbo.HrmMpFieldSpecificationDtls", "FieldSpecId");
            CreateIndex("dbo.HrmMpFieldDutyDtls", "DutyId");
            CreateIndex("dbo.HrmMpFieldDutyDtls", "FieldDutyId");
            CreateIndex("dbo.HrmMpFieldDuty", "ClassId");
            CreateIndex("dbo.HrmMpFieldDuty", "FieldPosId");
            CreateIndex("dbo.HrmMpFieldGroup", "EmpTypeId");
            CreateIndex("dbo.HrmMpFieldPosition", "ClassSpecId");
            CreateIndex("dbo.HrmMpFieldPosition", "FieldGroupId");
            CreateIndex("dbo.HrmMpFieldPosition", "PosTypeId");
            CreateIndex("dbo.HrmMpFieldPosition", "EmpTypeId");
            CreateIndex("dbo.HrmMpExecPosition", "ExecPosGroupId");
            CreateIndex("dbo.HrmPsEmpSkill", "SkillTypeId");
            CreateIndex("dbo.HrmPsEmpSkill", "EmpId");
            CreateIndex("dbo.HrmMpPosition", "CurrencyId");
            CreateIndex("dbo.HrmMpPosition", "SkillId");
            CreateIndex("dbo.HrmMpPosition", "PosWorkingUpperId");
            CreateIndex("dbo.HrmMpPosition", "PosUpperId");
            CreateIndex("dbo.HrmMpPosition", "JobSiteId");
            CreateIndex("dbo.HrmMpPosition", "EmpTypeId");
            CreateIndex("dbo.HrmMpPosition", "ExecPosId");
            CreateIndex("dbo.HrmMpPosition", "FieldPosId");
            CreateIndex("dbo.HrmPsEmployeeType", "YearTypeId");
            CreateIndex("dbo.HrmEsQuitRequest", "ApprovedId");
            CreateIndex("dbo.HrmEsQuitRequest", "EmpId");
            CreateIndex("dbo.HrmPsEmpContact", "DistrictId");
            CreateIndex("dbo.HrmPsEmpContact", "FamId");
            CreateIndex("dbo.HrmPsEmpContact", "NamePrefixId");
            CreateIndex("dbo.HrmPsEmpContact", "EmpId");
            CreateIndex("dbo.HrmPsEmpContact", "HrmPsEmployees_EmpId");
            CreateIndex("dbo.HrmEsMoveRequest", "ApprovedId");
            CreateIndex("dbo.HrmEsMoveRequest", "EmpId");
            CreateIndex("dbo.HrmTmpEmployee", "EmpTypeId");
            CreateIndex("dbo.HrmTmpEmployee", "EntTypeId");
            CreateIndex("dbo.HrmTmpEmployee", "MarrStatId");
            CreateIndex("dbo.HrmTmpEmployee", "BloodGroupId");
            CreateIndex("dbo.HrmTmpEmployee", "EmpStatusId");
            CreateIndex("dbo.HrmTmpEmployee", "NatId");
            CreateIndex("dbo.HrmTmpEmployee", "RaceNatId");
            CreateIndex("dbo.HrmTmpEmployee", "ReligionId");
            CreateIndex("dbo.HrmTmpEmployee", "GenderId");
            CreateIndex("dbo.HrmTmpEmployee", "NamePrefixId");
            CreateIndex("dbo.MasEduInstitute", "MaxEduDegreeId");
            CreateIndex("dbo.MasEduInstitute", "CountryId");
            CreateIndex("dbo.MasEduInstitute", "DistrictId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "MasEduQualification_EduQualId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "EduInsId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "EduMajorId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "EduQualId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "TmpEmpId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "HrmTmpEmployees_TmpEmpId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "TmpEmployee_TmpEmpId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "MasEduQualifications_EduQualId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "MasEduMajors_EduMajorId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "MasEduMajor_EduMajorId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "MasEduInstitutes_EduInsId");
            CreateIndex("dbo.HrmTmpEmployeeEducation", "MasEduInstitute_EduInsId");
            CreateIndex("dbo.MasEduQualification", "EduDegreeId");
            CreateIndex("dbo.HrmPsEduHistory", "EduInsId");
            CreateIndex("dbo.HrmPsEduHistory", "EduMajorId");
            CreateIndex("dbo.HrmPsEduHistory", "EduQualId");
            CreateIndex("dbo.HrmPsEduHistory", "EduDegreeId");
            CreateIndex("dbo.HrmPsEduHistory", "EmpId");
            CreateIndex("dbo.HrmPsEduHistory", "HrmPsEmployees_EmpId");
            CreateIndex("dbo.HrmMpPositionType", "EmpTypeId");
            CreateIndex("dbo.HrmMpPositionType", "HrmPsEmployeeTypes_EmpTypeId");
            CreateIndex("dbo.HrmMpClass", "EmpTypeId");
            CreateIndex("dbo.HrmMpClass", "PosTypeId");
            CreateIndex("dbo.HrmPsCommandDtls", "CurrencyId");
            CreateIndex("dbo.HrmPsCommandDtls", "TmpEduId");
            CreateIndex("dbo.HrmPsCommandDtls", "TmpEmpId");
            CreateIndex("dbo.HrmPsCommandDtls", "EntClassId");
            CreateIndex("dbo.HrmPsCommandDtls", "EntPosTypeId");
            CreateIndex("dbo.HrmPsCommandDtls", "NewExecPosId");
            CreateIndex("dbo.HrmPsCommandDtls", "NewPosTypeId");
            CreateIndex("dbo.HrmPsCommandDtls", "NewWorkingJobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "NewJobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "NewClassId");
            CreateIndex("dbo.HrmPsCommandDtls", "NewPosId");
            CreateIndex("dbo.HrmPsCommandDtls", "OldExecPosId");
            CreateIndex("dbo.HrmPsCommandDtls", "OldPosTypeId");
            CreateIndex("dbo.HrmPsCommandDtls", "OldWorkingJobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "OldJobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "OldClassId");
            CreateIndex("dbo.HrmPsCommandDtls", "OldPosId");
            CreateIndex("dbo.HrmPsCommandDtls", "MoveId");
            CreateIndex("dbo.HrmPsCommandDtls", "EduHisId");
            CreateIndex("dbo.HrmPsCommandDtls", "new_HrmMpExecPositions_ExecPosId");
            CreateIndex("dbo.HrmPsCommandDtls", "new_working_HrmMpJobSites_JobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "new_HrmMpJobSites_JobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "new_HrmMpClasses_ClassId");
            CreateIndex("dbo.HrmPsCommandDtls", "new_HrmMpPositions_PosId");
            CreateIndex("dbo.HrmPsCommandDtls", "old_HrmMpExecPositions_ExecPosId");
            CreateIndex("dbo.HrmPsCommandDtls", "old_working_HrmMpJobSites_JobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "old_HrmMpJobSites_JobSiteId");
            CreateIndex("dbo.HrmPsCommandDtls", "old_HrmMpClasses_ClassId");
            CreateIndex("dbo.HrmPsCommandDtls", "old_HrmMpPositions_PosId");
            CreateIndex("dbo.HrmPsCommandDtls", "EmpId");
            CreateIndex("dbo.HrmPsCommandDtls", "CmdId");
            CreateIndex("dbo.HrmPsCommandType", "CmdGroupId");
            CreateIndex("dbo.HrmPsCommandType", "HrmPsCommandGroups_CmdGroupId");
            CreateIndex("dbo.HrmPsCommand", "ApprovedId");
            CreateIndex("dbo.HrmPsCommand", "PenaltyId");
            CreateIndex("dbo.HrmPsCommand", "JobSiteId");
            CreateIndex("dbo.HrmPsCommand", "EmpTypeId");
            CreateIndex("dbo.HrmPsCommand", "CmdTypeId");
            CreateIndex("dbo.HrmPsCommand", "HrmDcPenalty_PenId");
            CreateIndex("dbo.HrmPsCommand", "approver_EmpId");
            CreateIndex("dbo.HrmPsCommand", "HrmMpJobSites_JobSiteId");
            CreateIndex("dbo.HrmPsCommand", "HrmPsEmployeeTypes_EmpTypeId");
            CreateIndex("dbo.HrmPsCommand", "HrmPsCommandTypes_CmdTypeId");
            CreateIndex("dbo.SysPermission", "RoleId");
            CreateIndex("dbo.SysUserRole", "EmpTypeId");
            CreateIndex("dbo.SysUserRole", "RoleId");
            CreateIndex("dbo.SysUserRole", "PosId");
            CreateIndex("dbo.SysUserRole", "UserId");
            CreateIndex("dbo.SysMessage", "ToEmpId");
            CreateIndex("dbo.SysMessage", "FromEmpId");
            CreateIndex("dbo.SysUser", "EmpId");
            CreateIndex("dbo.IcmPurchaseOrderItem", "BidderQuoId");
            CreateIndex("dbo.IcmPurchaseOrderItem", "PoId");
            CreateIndex("dbo.IcmDeliveryNoteItemExtra", "ResItemId");
            CreateIndex("dbo.IcmDeliveryNoteItemExtra", "DnId");
            CreateIndex("dbo.IcmMovementHistory", "AssetId");
            CreateIndex("dbo.IcmFile", "Employee_EmpId");
            CreateIndex("dbo.IcmFile", "RefType");
            CreateIndex("dbo.IcmCommittee", "EmpId");
            CreateIndex("dbo.IcmCommittee", "RefType");
            CreateIndex("dbo.IcmCommittee", "ComTypeId");
            CreateIndex("dbo.IcmCommittee", "ComPositionId");
            CreateIndex("dbo.IcmCommittee", "ComFunctionId");
            CreateIndex("dbo.IcmMovementDtl", "AssetId");
            CreateIndex("dbo.IcmMovementDtl", "MovementId");
            CreateIndex("dbo.IcmMovement", "SourceJobSiteId");
            CreateIndex("dbo.IcmMovement", "DestinationWarehouseId");
            CreateIndex("dbo.IcmMovement", "SourceWarehouseId");
            CreateIndex("dbo.IcmMovement", "ResTypeId");
            CreateIndex("dbo.IcmDispenseHistory", "DispenseId");
            CreateIndex("dbo.IcmDispenseHistory", "WhId");
            CreateIndex("dbo.IcmDispenseHistory", "ResItemId");
            CreateIndex("dbo.IcmDispense", "ProjectId");
            CreateIndex("dbo.IcmDispense", "RequestParcelId");
            CreateIndex("dbo.IcmDispense", "RequestById");
            CreateIndex("dbo.IcmDispense", "FromJobSiteId");
            CreateIndex("dbo.IcmDispense", "WhId");
            CreateIndex("dbo.IcmRequestParcelDtl", "JobsiteId");
            CreateIndex("dbo.IcmRequestParcelDtl", "PprId");
            CreateIndex("dbo.IcmRequestParcelDtl", "ResItemId");
            CreateIndex("dbo.IcmRequestParcelDtl", "ReqId");
            CreateIndex("dbo.IcmRequestParcel", "ProjectId");
            CreateIndex("dbo.IcmRequestParcel", "IcmResTypeId");
            CreateIndex("dbo.IcmRequestParcel", "WarehousePermitId");
            CreateIndex("dbo.IcmRequestParcel", "RequestBy");
            CreateIndex("dbo.IcmRequestParcel", "JobSiteId");
            CreateIndex("dbo.IcmOfficeSuppliesLot", "ResItemId");
            CreateIndex("dbo.IcmOfficeSuppliesLot", "ProjExpId");
            CreateIndex("dbo.IcmOfficeSuppliesLot", "UnitId");
            CreateIndex("dbo.IcmOfficeSuppliesLot", "WhId");
            CreateIndex("dbo.IcmOfficeSuppliesLot", "ReceiveDtlId");
            CreateIndex("dbo.IcmAssetWarranty", "AssetId");
            CreateIndex("dbo.IcmAsset", "DepreciationTypeId");
            CreateIndex("dbo.IcmAsset", "JobSiteId");
            CreateIndex("dbo.IcmAsset", "AssetStatusId");
            CreateIndex("dbo.IcmAsset", "ResGrpId");
            CreateIndex("dbo.IcmAsset", "ResSubGrpId");
            CreateIndex("dbo.IcmAsset", "UnitId");
            CreateIndex("dbo.IcmAsset", "WhId");
            CreateIndex("dbo.IcmAsset", "AssetTypeId");
            CreateIndex("dbo.IcmAsset", "ResItemId");
            CreateIndex("dbo.IcmAsset", "ProjExpId");
            CreateIndex("dbo.IcmAsset", "ReceiveDtlId");
            CreateIndex("dbo.IcmReceiveDtl", "DepreciationTypeId");
            CreateIndex("dbo.IcmReceiveDtl", "ProjExpId");
            CreateIndex("dbo.IcmReceiveDtl", "UnitId");
            CreateIndex("dbo.IcmReceiveDtl", "ResourceTypeId");
            CreateIndex("dbo.IcmReceiveDtl", "ResourceItemId");
            CreateIndex("dbo.IcmReceiveDtl", "ReceiveId");
            CreateIndex("dbo.IcmWarehousePermit", "JobSiteId");
            CreateIndex("dbo.IcmWarehousePermit", "WhId");
            CreateIndex("dbo.IcmReceive", "ReceiveTypeId");
            CreateIndex("dbo.IcmReceive", "DnId");
            CreateIndex("dbo.IcmReceive", "WhId");
            CreateIndex("dbo.IcmMasContactPartner", "ConId");
            CreateIndex("dbo.IcmMasContactBank", "BranchId");
            CreateIndex("dbo.IcmMasContactBank", "ConId");
            CreateIndex("dbo.IcmMasPurchaseRegularMapping", "BgSourceId");
            CreateIndex("dbo.IcmMasPurchaseRegularMapping", "RegularId");
            CreateIndex("dbo.FimMasFund", "ConId");
            CreateIndex("dbo.FimEmployeeTax", "FundTypeId");
            CreateIndex("dbo.FimEmployeeTax", "EmpId");
            CreateIndex("dbo.IcmPurchaseOrderPenalty", "RateTypeId");
            CreateIndex("dbo.IcmPurchaseOrderPenalty", "PoId");
            CreateIndex("dbo.IcmDeliveryNotePenalty", "PoPenId");
            CreateIndex("dbo.IcmDeliveryNotePenalty", "DnId");
            CreateIndex("dbo.FimReceive", "PayId");
            CreateIndex("dbo.FimReceive", "PayReqId");
            CreateIndex("dbo.FimReceive", "PetitionId");
            CreateIndex("dbo.FimReceive", "TransferId");
            CreateIndex("dbo.FimReceive", "TranGrpId");
            CreateIndex("dbo.FimReceive", "PoInstalId");
            CreateIndex("dbo.FimReceive", "DnPenId");
            CreateIndex("dbo.FimReceive", "PrePayColId");
            CreateIndex("dbo.FimReceive", "PoColId");
            CreateIndex("dbo.FimReceive", "BidOfferColId");
            CreateIndex("dbo.FimReceive", "BidderId");
            CreateIndex("dbo.FimReceive", "EmpId");
            CreateIndex("dbo.FimReceive", "ContactId");
            CreateIndex("dbo.FimReceive", "BankAccId");
            CreateIndex("dbo.FimReceive", "BranchId");
            CreateIndex("dbo.FimReceive", "ReceiveMethodId");
            CreateIndex("dbo.FimReceive", "ReceiveTypeId");
            CreateIndex("dbo.FimReceive", "WorkAreaId");
            CreateIndex("dbo.FimReceive", "BgSourceId");
            CreateIndex("dbo.FimPayCheque", "ChequeId");
            CreateIndex("dbo.FimPayCheque", "PayId");
            CreateIndex("dbo.FimPayRequestDtlRate", "PayRequestDtlId");
            CreateIndex("dbo.FimCheque", "ChequeBookId");
            CreateIndex("dbo.FimChequeBook", "BankAccId");
            CreateIndex("dbo.FimMasBorrowType", "BgSourceId");
            CreateIndex("dbo.FimMasReceiveType", "AccountId");
            CreateIndex("dbo.FimMasReceiveType", "BankAccId");
            CreateIndex("dbo.FimMasReceiveType", "BgSourceId");
            CreateIndex("dbo.FimMasExpenseRate", "BgSourceId");
            CreateIndex("dbo.FimMasExpenseRate", "BgExpId");
            CreateIndex("dbo.bgm_strategy_data_list", "bgm_strat_type_seq");
            CreateIndex("dbo.IcmBidderCollateral", "BidderId");
            CreateIndex("dbo.IcmBidderCollateral", "ColCategoryId");
            CreateIndex("dbo.IcmBidderCollateral", "ColStatusId");
            CreateIndex("dbo.IcmBidderCollateral", "ColTypeId");
            CreateIndex("dbo.FimPay", "TranGrpId");
            CreateIndex("dbo.FimPay", "PostPayId");
            CreateIndex("dbo.FimPay", "BidderColId");
            CreateIndex("dbo.FimPay", "ContactId");
            CreateIndex("dbo.FimPay", "EmpId");
            CreateIndex("dbo.FimPay", "PetitionDtlId");
            CreateIndex("dbo.FimPay", "PetitionId");
            CreateIndex("dbo.FimPay", "PayReqId");
            CreateIndex("dbo.FimPay", "PayMethodId");
            CreateIndex("dbo.FimPay", "PayEventId");
            CreateIndex("dbo.FimPay", "WorkAreaId");
            CreateIndex("dbo.FimPay", "BgSourceId");
            CreateIndex("dbo.FimPetition", "TranGrpId");
            CreateIndex("dbo.FimPetition", "PetitionTypeId");
            CreateIndex("dbo.FimPetition", "BgSourceId");
            CreateIndex("dbo.FimPetitionDtl", "JobSiteId");
            CreateIndex("dbo.FimPetitionDtl", "PayReqId");
            CreateIndex("dbo.FimPetitionDtl", "PetitionId");
            CreateIndex("dbo.FimReturn", "TranGrpId");
            CreateIndex("dbo.FimReturn", "PayReqId");
            CreateIndex("dbo.FimReturnDtl", "PayReqDtlId");
            CreateIndex("dbo.FimReturnDtl", "ReturnId");
            CreateIndex("dbo.FimPayRequest", "TranGrpId");
            CreateIndex("dbo.FimPayRequest", "DebtorContactId");
            CreateIndex("dbo.FimPayRequest", "DebtorEmpId");
            CreateIndex("dbo.FimPayRequest", "BorrowTypeId");
            CreateIndex("dbo.FimPayRequest", "DnId");
            CreateIndex("dbo.FimPayRequest", "ContactId");
            CreateIndex("dbo.FimPayRequest", "JobSiteId");
            CreateIndex("dbo.FimPayRequest", "EmpId");
            CreateIndex("dbo.FimPayRequest", "ProjOperId");
            CreateIndex("dbo.FimPayRequest", "AdvanceBgSourceId");
            CreateIndex("dbo.FimPayRequest", "PayEventId");
            CreateIndex("dbo.FimPayRequest", "ExpGrpId");
            CreateIndex("dbo.FimPayRequest", "WorkAreaId");
            CreateIndex("dbo.FimPayRequest", "BgSourceId");
            CreateIndex("dbo.FimPayRequestDtl", "JobSiteId");
            CreateIndex("dbo.FimPayRequestDtl", "ProjOperExpId");
            CreateIndex("dbo.FimPayRequestDtl", "PayReqId");
            CreateIndex("dbo.IcmWarehouse", "JobSiteId");
            CreateIndex("dbo.IcmWarehouse", "ScopeId");
            CreateIndex("dbo.IcmDeliveryNote", "TranGrpId");
            CreateIndex("dbo.IcmDeliveryNote", "ProgId");
            CreateIndex("dbo.IcmDeliveryNote", "DeliveryJobSiteId");
            CreateIndex("dbo.IcmDeliveryNote", "DeliveryEmpId");
            CreateIndex("dbo.IcmDeliveryNote", "YearTypeId");
            CreateIndex("dbo.IcmDeliveryNote", "WhId");
            CreateIndex("dbo.IcmDeliveryNote", "PoInstallId");
            CreateIndex("dbo.IcmDeliveryNote", "PoId");
            CreateIndex("dbo.IcmDeliveryNote", "ProjOperExpId");
            CreateIndex("dbo.IcmDeliveryNoteItem", "ResItemId");
            CreateIndex("dbo.IcmDeliveryNoteItem", "PoInstallItemId");
            CreateIndex("dbo.IcmDeliveryNoteItem", "DnId");
            CreateIndex("dbo.IcmPurchaseOrder", "YearTypeId");
            CreateIndex("dbo.IcmPurchaseOrder", "ProgressId");
            CreateIndex("dbo.IcmPurchaseOrder", "DurTypeId");
            CreateIndex("dbo.IcmPurchaseOrder", "PcTypeId");
            CreateIndex("dbo.IcmPurchaseOrder", "BidderId");
            CreateIndex("dbo.IcmPurchaseOrderInstallment", "DurTypeId");
            CreateIndex("dbo.IcmPurchaseOrderInstallment", "PoId");
            CreateIndex("dbo.IcmBid", "CancelEmpId");
            CreateIndex("dbo.IcmBid", "ConfirmEmpId");
            CreateIndex("dbo.IcmBid", "BidJobSiteId");
            CreateIndex("dbo.IcmBid", "BidEmpId");
            CreateIndex("dbo.IcmBid", "YearTypeId");
            CreateIndex("dbo.IcmBid", "PrId");
            CreateIndex("dbo.IcmBidder", "VatTypeId");
            CreateIndex("dbo.IcmBidder", "DurTypeId");
            CreateIndex("dbo.IcmBidder", "PrId");
            CreateIndex("dbo.IcmBidder", "BidId");
            CreateIndex("dbo.IcmBidder", "ConId");
            CreateIndex("dbo.IcmBidderQuotation", "PrItemId");
            CreateIndex("dbo.IcmBidderQuotation", "BidderId");
            CreateIndex("dbo.IcmPurchaseOrderInstallmentItem", "PoInstallId");
            CreateIndex("dbo.IcmPurchaseOrderInstallmentItem", "BidderQuoId");
            CreateIndex("dbo.IcmMasPurchaseMethod", "PcTypeId");
            CreateIndex("dbo.IcmPurchaseRequest", "ProgressId");
            CreateIndex("dbo.IcmPurchaseRequest", "DurCountId");
            CreateIndex("dbo.IcmPurchaseRequest", "DurTypeId");
            CreateIndex("dbo.IcmPurchaseRequest", "PriorityId");
            CreateIndex("dbo.IcmPurchaseRequest", "CancelEmpId");
            CreateIndex("dbo.IcmPurchaseRequest", "ConfirmEmpId");
            CreateIndex("dbo.IcmPurchaseRequest", "PurchaseJobSiteId");
            CreateIndex("dbo.IcmPurchaseRequest", "PurchaseEmpId");
            CreateIndex("dbo.IcmPurchaseRequest", "YearTypeId");
            CreateIndex("dbo.IcmPurchaseRequest", "PcMethodId");
            CreateIndex("dbo.IcmPurchaseRequest", "PcTypeId");
            CreateIndex("dbo.IcmPurchaseRequest", "RegularId");
            CreateIndex("dbo.IcmPurchaseRequestItem", "ResItemId");
            CreateIndex("dbo.IcmPurchaseRequestItem", "BgExpId");
            CreateIndex("dbo.IcmPurchaseRequestItem", "PrId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "ProgressId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "DurCountId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "DurTypeId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "PriorityId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "RequestJobSiteId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "RequestEmpId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "YearTypeId");
            CreateIndex("dbo.IcmPrePurchaseRequest", "PcTypeId");
            CreateIndex("dbo.IcmPrePurchaseRequestItem", "BgSourceId");
            CreateIndex("dbo.IcmPrePurchaseRequestItem", "BgExpId");
            CreateIndex("dbo.IcmPrePurchaseRequestItem", "PrItemId");
            CreateIndex("dbo.IcmPrePurchaseRequestItem", "PprId");
            CreateIndex("dbo.IcmPrePurchaseRequestItem", "ResItemId");
            CreateIndex("dbo.IcmPrePurchaseRequestItem", "RegularId");
            CreateIndex("dbo.IcmPrePurchaseRequestItem", "ProjOperExpId");
            CreateIndex("dbo.bgm_project_operation_report", "pay_seq");
            CreateIndex("dbo.bgm_project_operation_report", "petition_dtls_seq");
            CreateIndex("dbo.bgm_project_operation_report", "return_dtls_seq");
            CreateIndex("dbo.bgm_project_operation_report", "money_req_dtls_seq");
            CreateIndex("dbo.bgm_project_operation_report", "icm_dn_item_seq");
            CreateIndex("dbo.bgm_project_operation_report", "icm_po_install_item_seq");
            CreateIndex("dbo.bgm_project_operation_report", "icm_pr_item_seq");
            CreateIndex("dbo.bgm_project_operation_report", "icm_ppr_item_seq");
            CreateIndex("dbo.bgm_project_operation_report", "bgm_proj_oper_exp_seq");
            CreateIndex("dbo.IcmMasLookUp", "LookUpTypeId");
            CreateIndex("dbo.IcmMasContact", "VatTypeId");
            CreateIndex("dbo.IcmMasContact", "ConStatusId");
            CreateIndex("dbo.IcmMasContact", "ConGrpId");
            CreateIndex("dbo.bgm_project_operation_person", "ContactId");
            CreateIndex("dbo.bgm_project_operation_person", "emp_seq");
            CreateIndex("dbo.bgm_project_operation_person", "bgm_proj_oper_seq");
            CreateIndex("dbo.bgm_project_operation", "job_site_seq");
            CreateIndex("dbo.bgm_project_operation", "emp_seq");
            CreateIndex("dbo.bgm_project_operation", "bgm_proj_seq");
            CreateIndex("dbo.bgm_project_operation_expense", "bgm_proj_exp_seq");
            CreateIndex("dbo.bgm_project_operation_expense", "bgm_proj_oper_seq");
            CreateIndex("dbo.bgm_project_report", "bgm_proj_oper_exp_seq");
            CreateIndex("dbo.bgm_project_report", "bgm_proj_exp_seq");
            CreateIndex("dbo.bgm_mas_option", "bgm_option_type_seq");
            CreateIndex("dbo.bgm_mas_option", "job_site_seq");
            CreateIndex("dbo.bgm_mas_option", "upper_bgm_option_seq");
            CreateIndex("dbo.bgm_project_option", "bgm_proj_seq");
            CreateIndex("dbo.bgm_project_option", "bgm_option_seq");
            CreateIndex("dbo.bgm_project_manager", "emp_seq");
            CreateIndex("dbo.bgm_project_manager", "bgm_proj_seq");
            CreateIndex("dbo.bgm_project_activity_plan", "bgm_proj_seq");
            CreateIndex("dbo.IcmMasResourceGroup", "CumdepreAccountId");
            CreateIndex("dbo.IcmMasResourceGroup", "ConsumeAccountId");
            CreateIndex("dbo.IcmMasResourceGroup", "BreakAccountId");
            CreateIndex("dbo.IcmMasResourceGroup", "DepreAccountId");
            CreateIndex("dbo.IcmMasResourceGroup", "AssetAccountId");
            CreateIndex("dbo.IcmMasResourceGroup", "DpTypeId");
            CreateIndex("dbo.IcmMasResourceGroup", "ResTypeId");
            CreateIndex("dbo.IcmMasResourceSubGroup", "DpTypeId");
            CreateIndex("dbo.IcmMasResourceSubGroup", "ResGrpId");
            CreateIndex("dbo.IcmMasResourceItem", "UnitId");
            CreateIndex("dbo.IcmMasResourceItem", "ResSubGrpId");
            CreateIndex("dbo.bgm_project_expense", "icm_res_item_seq");
            CreateIndex("dbo.bgm_project_expense", "bgm_exp_seq");
            CreateIndex("dbo.bgm_project_expense", "bgm_source_seq");
            CreateIndex("dbo.bgm_project_expense", "bgm_proj_seq");
            CreateIndex("dbo.bgm_mas_expense_source", "bgm_source_seq");
            CreateIndex("dbo.bgm_mas_expense_source", "bgm_exp_seq");
            CreateIndex("dbo.bgm_mas_expense", "account_seq");
            CreateIndex("dbo.bgm_mas_expense", "bgm_exp_grp_id_real");
            CreateIndex("dbo.bgm_mas_expense", "bgm_exp_grp_seq");
            CreateIndex("dbo.bgm_mas_expense", "upper_bgm_exp_seq");
            CreateIndex("dbo.AcmTransectionDtl", "AccountId");
            CreateIndex("dbo.AcmTransectionDtl", "TranId");
            CreateIndex("dbo.HrmFieldPosition", "ClassSpecId");
            CreateIndex("dbo.HrmFieldPosition", "PosTypeId");
            CreateIndex("dbo.HrmFieldPosition", "EmpTypeId");
            CreateIndex("dbo.HrmMasCity", "CountryId");
            CreateIndex("dbo.HrmMasAmphur", "ProvinceId");
            CreateIndex("dbo.HrmMasDistrict", "AmphurId");
            CreateIndex("dbo.HrmMasJobSiteType", "CurrentJobSiteId");
            CreateIndex("dbo.HrmJobSite", "MpJobSiteType_JobSiteTypeId");
            CreateIndex("dbo.HrmJobSite", "JobSite_JobSiteId");
            CreateIndex("dbo.HrmJobSite", "JobSiteStatusId");
            CreateIndex("dbo.HrmJobSite", "CountryId");
            CreateIndex("dbo.HrmJobSite", "CityId");
            CreateIndex("dbo.HrmJobSite", "ProvnceId");
            CreateIndex("dbo.HrmJobSite", "DistrictId");
            CreateIndex("dbo.HrmJobSite", "JobSiteLevelId");
            CreateIndex("dbo.HrmJobSite", "WorkAreaId");
            CreateIndex("dbo.HrmJobSite", "JobSiteTypeId");
            CreateIndex("dbo.HrmJobSite", "UpperJobSiteId");
            CreateIndex("dbo.HrmPosition", "Position_PosId1");
            CreateIndex("dbo.HrmPosition", "Position_PosId");
            CreateIndex("dbo.HrmPosition", "PosStatusId");
            CreateIndex("dbo.HrmPosition", "EmpTypeId");
            CreateIndex("dbo.HrmPosition", "ExecPosId");
            CreateIndex("dbo.HrmPosition", "FieldPosId");
            CreateIndex("dbo.HrmPosition", "JobSiteId");
            CreateIndex("dbo.HrmPosition", "WorkingUpperPosId");
            CreateIndex("dbo.HrmPosition", "UpperPosId");
            CreateIndex("dbo.HrmMasPositionType", "EmpTypeId");
            CreateIndex("dbo.HrmMasClass", "EmpTypeId");
            CreateIndex("dbo.HrmMasClass", "PosTypeId");
            CreateIndex("dbo.HrmMasEmployeeType", "YearTypeId");
            CreateIndex("dbo.HrmMasNamePrefix", "GenderId");
            CreateIndex("dbo.HrmEmployee", "MaritalStatusId");
            CreateIndex("dbo.HrmEmployee", "ExecPosId");
            CreateIndex("dbo.HrmEmployee", "EmpStatusId");
            CreateIndex("dbo.HrmEmployee", "WorkingJobSiteId");
            CreateIndex("dbo.HrmEmployee", "PosId");
            CreateIndex("dbo.HrmEmployee", "ClassId");
            CreateIndex("dbo.HrmEmployee", "EmpTypeId");
            CreateIndex("dbo.HrmEmployee", "NationalId");
            CreateIndex("dbo.HrmEmployee", "RaceNationalId");
            CreateIndex("dbo.HrmEmployee", "ReligionId");
            CreateIndex("dbo.HrmEmployee", "GenderId");
            CreateIndex("dbo.HrmEmployee", "NamePrefixId");
            CreateIndex("dbo.FimMasLookUp", "LookUpTypeId");
            CreateIndex("dbo.FimMasBankBranch", "BankId");
            CreateIndex("dbo.FimMasBankAccount", "WorkAreaId");
            CreateIndex("dbo.FimMasBankAccount", "AccountId");
            CreateIndex("dbo.FimMasBankAccount", "BankAccTypeId");
            CreateIndex("dbo.FimMasBankAccount", "SavingBankAccId");
            CreateIndex("dbo.FimMasBankAccount", "BgmSourceId");
            CreateIndex("dbo.FimMasBankAccount", "BranchId");
            CreateIndex("dbo.HrmMasScope", "MasScope_ScopeId");
            CreateIndex("dbo.HrmMasWorkArea", "ScopeId");
            CreateIndex("dbo.bgm_mas_source", "bgm_year_type_seq");
            CreateIndex("dbo.bgm_mas_source", "bgm_source_type_seq");
            CreateIndex("dbo.bgm_mas_source", "upper_bgm_source_seq");
            CreateIndex("dbo.FimTransfer", "EmpId");
            CreateIndex("dbo.FimTransfer", "ToBankAccId");
            CreateIndex("dbo.FimTransfer", "FromBankAccId");
            CreateIndex("dbo.FimTransfer", "WorkAreaId");
            CreateIndex("dbo.FimTransfer", "BgSourceId");
            CreateIndex("dbo.AcmTransection", "BgSourceId");
            CreateIndex("dbo.AcmTransection", "WorkAreaId");
            CreateIndex("dbo.AcmTransection", "TransferId");
            CreateIndex("dbo.AcmMasAccount", "VersionId");
            CreateIndex("dbo.AcmMasAccount", "UpperAccountId");
            AddForeignKey("dbo.HrmActivityRequest", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmActivityRequest", "ActId", "dbo.HrmActivity", "ActId", cascadeDelete: true);
            AddForeignKey("dbo.HrmActivity", "CityId", "dbo.HrmMasCity", "CityId");
            AddForeignKey("dbo.HrmActivity", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmActivity", "ActTypeId", "dbo.HrmActivityType", "ActTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmActivity", "BgmProjOperId", "dbo.bgm_project_operation", "bgm_proj_oper_seq");
            AddForeignKey("dbo.HrmPsAbsenceRule", "AbsenceTypeId", "dbo.HrmPsAbsenceType", "AbsenceTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsAbsenceRule", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsAbsence", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsAbsence", "AbsenceTypeId", "dbo.HrmPsAbsenceType", "AbsenceTypeId");
            AddForeignKey("dbo.bgm_request", "job_site_seq", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.bgm_request", "prj_type_seq", "dbo.bgm_project_type", "prj_type_seq");
            AddForeignKey("dbo.bgm_request", "bgm_strat_list_seq", "dbo.bgm_strategy_data_list", "bgm_strat_list_seq");
            AddForeignKey("dbo.HrmEsMail", "ReqId", "dbo.bgm_request", "bgm_req_seq");
            AddForeignKey("dbo.HrmEsMail", "ReceiverId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmEsMail", "SenderId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmEsMail", "MailTypeId", "dbo.HrmEsMail", "MailId");
            AddForeignKey("dbo.HrmEsResponse", "RespNextId", "dbo.HrmEsResponse", "RespId");
            AddForeignKey("dbo.HrmEsResponse", "MailId", "dbo.HrmEsMail", "MailId");
            AddForeignKey("dbo.HrmAprAppraisal", "StdScoreId", "dbo.HrmAppraisalStdScore", "StdScoreId");
            AddForeignKey("dbo.HrmAprAppraisal", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmScholarshipRequest", "ScholarGroupId", "dbo.HrmScholarshipGroup", "ScholarGroupId");
            AddForeignKey("dbo.HrmScholarshipRequest", "ResponseTypeId", "dbo.HrmEsResponse", "RespId");
            AddForeignKey("dbo.HrmScholarshipRequest", "EduQualId", "dbo.MasEduQualification", "EduQualId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarshipRequest", "ApContactDistrictId", "dbo.HrmMasDistrict", "DistrictId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarshipRequest", "ApCitizenId", "dbo.HrmScholarshipRequest", "TranId");
            AddForeignKey("dbo.HrmScholarshipRequest", "ApFhId", "dbo.HrmAprAppraisal", "AprId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarshipRequest", "EduMajorId", "dbo.MasEduMajor", "EduMajorId");
            AddForeignKey("dbo.HrmScholarshipRequest", "EduInsId", "dbo.HrmPsEmpEducation", "EduId");
            AddForeignKey("dbo.HrmScholarshipRequest", "ScholarId", "dbo.HrmScholarship", "ScholarId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarshipRequest", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarshipGroupDtls", "ScholarId", "dbo.HrmScholarship", "ScholarId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarshipGroupDtls", "EduMajorId", "dbo.MasEduMajor", "EduMajorId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarshipGroup", "ScholarId", "dbo.HrmScholarship", "ScholarId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarship", "CountryId", "dbo.HrmMasCountry", "CountryId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarship", "EduDegreeId", "dbo.MasEduDegree", "EduDegreeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarship", "ScholarFundId", "dbo.HrmScholarshipFund", "ScholarFundId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScholarship", "ScholarTypeId", "dbo.HrmScholarshipType", "ScholarTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainingSubjectDtls", "TrainingSubjectId", "dbo.HrmTrainingSubject", "TrainingSubjectId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainer", "DistrictId", "dbo.HrmMasDistrict", "DistrictId");
            AddForeignKey("dbo.HrmTrainer", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmTrainer", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmTrainingCourseTrainer", "TrainingSubjectDtlsId", "dbo.HrmTrainingSubjectDtls", "TrainingSubjectDtlsId");
            AddForeignKey("dbo.HrmTrainingCourseTrainer", "TrainingSubjectId", "dbo.HrmTrainingSubject", "TrainingSubjectId");
            AddForeignKey("dbo.HrmTrainingCourseTrainer", "TrainerId", "dbo.HrmTrainer", "TrainerId");
            AddForeignKey("dbo.HrmTrainingCourseTrainer", "TrainId", "dbo.HrmTrainingRequest", "RequestId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainingCourseQuota", "JobSiteId", "dbo.HrmJobSite", "JobSiteId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainingCourseQuota", "TrainId", "dbo.HrmTrainingRequest", "RequestId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainingCourseTrainee", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmTrainingCourseTrainee", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmTrainingCourseTrainee", "TrainId", "dbo.HrmTrainingRequest", "RequestId");
            AddForeignKey("dbo.HrmTrainingInstitute", "CountryId", "dbo.HrmMasCountry", "CountryId");
            AddForeignKey("dbo.HrmScholarshipFund", "ScholarTypeId", "dbo.HrmScholarshipType", "ScholarTypeId");
            AddForeignKey("dbo.HrmTrainingType", "TrainingCatId", "dbo.HrmTrainingTypeCategory", "TrainingCatId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainingCurriculum", "TrainingTypeId", "dbo.HrmTrainingType", "TrainingTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainingCourse", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.HrmTrainingCourse", "TrainingGroupId", "dbo.HrmTrainingGroup", "TrainingGroupId");
            AddForeignKey("dbo.HrmTrainingCourse", "CountryId", "dbo.HrmMasCountry", "CountryId");
            AddForeignKey("dbo.HrmTrainingCourse", "TrainingInsId", "dbo.HrmTrainingInstitute", "TrainingInsId");
            AddForeignKey("dbo.HrmTrainingCourse", "EpcId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmTrainingCourse", "ScholarFundId", "dbo.HrmScholarshipFund", "ScholarFundId");
            AddForeignKey("dbo.HrmTrainingCourse", "EmpSecId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmTrainingCourse", "TrainingCurId", "dbo.HrmTrainingCurriculum", "TrainingCurId");
            AddForeignKey("dbo.HrmTrainingRequest", "StatusId", "dbo.HrmDcStatus", "StatId", cascadeDelete: true);
            AddForeignKey("dbo.HrmTrainingRequest", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsTimeAttendant", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpSpecialSkill", "SkillTypeId", "dbo.MasSkillType", "SkillTypeId");
            AddForeignKey("dbo.HrmPsEmpSpecialSkill", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsEmpSpecialExpert", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmScUser", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmScUser", "ScEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPrSalaryGroup", "ClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmPrSalaryGroup", "PosTypeId", "dbo.HrmMasPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmPrSalaryGroup", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmPsRoyalItemRepayDtls", "GenderId", "dbo.HrmMasGender", "GenderId");
            AddForeignKey("dbo.HrmPsRoyalItemRepayDtls", "RoyalItemId", "dbo.HrmPsRoyalItem", "RoyalItemId");
            AddForeignKey("dbo.HrmPsRoyalItemRepayDtls", "RepayId", "dbo.HrmPsRoyalItemRepay", "RepayId");
            AddForeignKey("dbo.HrmPsRoyalItemRequest", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsRoyalItemRequest", "ClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmPsRoyalItemRequest", "PosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPsRoyalItemRequest", "CurrRoyalItemId", "dbo.HrmPsRoyalItem", "RoyalItemId");
            AddForeignKey("dbo.HrmPsRoyalItemRequest", "RoyalItemId", "dbo.HrmPsRoyalItem", "RoyalItemId");
            AddForeignKey("dbo.HrmPsRoyalItemRequest", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsRoyalItemHistory", "RoyalItemId", "dbo.HrmPsRoyalItem", "RoyalItemId");
            AddForeignKey("dbo.HrmPsRoyalItemHistory", "RoyalItemReqId", "dbo.HrmPsRoyalItemRequest", "ReqId");
            AddForeignKey("dbo.HrmPsRoyalItemHistory", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsRoyalItem", "RoyalItemTypeId", "dbo.HrmPsRoyalItemType", "RoyalItemTypeId");
            AddForeignKey("dbo.HrmPsRoyalItemControl", "RoyalItemId", "dbo.HrmPsRoyalItem", "RoyalItemId");
            AddForeignKey("dbo.HrmPsRoyalItemControl", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsRetirementDtls", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsRetirementDtls", "RetireId", "dbo.HrmPsRetirement", "RetireId");
            AddForeignKey("dbo.HrmPsRetirement", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsRetirement", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmRcCatalog", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmPrExtraType", "ContactId", "dbo.IcmMasContact", "ConId");
            AddForeignKey("dbo.HrmPrExtraType", "CmdTypeId", "dbo.HrmPsCommandType", "CmdTypeId");
            AddForeignKey("dbo.HrmPrExtraType", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMpPositionDutyDtls", "PosDutyId", "dbo.HrmMpPositionDuty", "PosDutyId");
            AddForeignKey("dbo.HrmMpPositionDuty", "DutyId", "dbo.HrmMpDuty", "DutyId");
            AddForeignKey("dbo.HrmMpPositionDuty", "PosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPsNwdJobSite", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsNwdJobSite", "NonWorkingId", "dbo.HrmPsNonWorkingDay", "NonWorkingId");
            AddForeignKey("dbo.MasRegion", "CountryId", "dbo.HrmMasCountry", "CountryId");
            AddForeignKey("dbo.HrmPsEmpLegatee", "FamId", "dbo.MasFamilyhood", "FamId");
            AddForeignKey("dbo.HrmPsEmpLegatee", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmPsEmpLegatee", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmMpJobSiteType", "CurrJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmMpJobSiteType", "current_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmMpJobSiteCommandDtls", "ToJobSiteLevelId", "dbo.HrmMasJobSiteLevel", "JobSiteLevelId");
            AddForeignKey("dbo.HrmMpJobSiteCommandDtls", "FromJobSiteLevelId", "dbo.HrmMasJobSiteLevel", "JobSiteLevelId");
            AddForeignKey("dbo.HrmMpJobSiteCommandDtls", "ToUpperId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmMpJobSiteCommandDtls", "FromUpperId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmMpJobSiteCommandDtls", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmMpJobSiteCommandDtls", "JobSiteCmdId", "dbo.HrmMpJobSiteCommand", "JobSiteCmdId", cascadeDelete: true);
            AddForeignKey("dbo.HrmMpJobSiteCommand", "JobSiteTypeId", "dbo.HrmMasJobSiteType", "JobSiteTypeId");
            AddForeignKey("dbo.HrmMpJobSiteArea", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsEmpParent", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmPsEmpParent", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmChgRequest", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmChgRequest", "ChgTypeId", "dbo.ChgTypes", "ChgTypeId");
            AddForeignKey("dbo.HrmChgSpouse", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmChgSpouse", "SpouseId", "dbo.HrmChgSpouse", "ChgSpouseId");
            AddForeignKey("dbo.HrmChgSpouse", "ChgReqId", "dbo.HrmChgRequest", "ChgReqId");
            AddForeignKey("dbo.HrmPsEmpChildren", "SpouseId", "dbo.HrmChgSpouse", "ChgSpouseId");
            AddForeignKey("dbo.HrmPsEmpChildren", "EduInsId", "dbo.MasEduInstitute", "EduInsId");
            AddForeignKey("dbo.HrmPsEmpChildren", "EduDegreeId", "dbo.MasEduDegree", "EduDegreeId");
            AddForeignKey("dbo.HrmPsEmpChildren", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmPsEmpChildren", "GenderId", "dbo.HrmMasGender", "GenderId");
            AddForeignKey("dbo.HrmPsEmpChildren", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsEmpChildren", "HrmPsEmployees_EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpSpouse", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmPsEmpSpouse", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsEmpMovment", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmPsEmpSalaryHistory", "MoveId", "dbo.HrmEsMoveRequest", "ReqId");
            AddForeignKey("dbo.HrmPsEmpSalaryHistory", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsEmpSalaryHistory", "ClassId", "dbo.HrmMpClass", "ClassId");
            AddForeignKey("dbo.HrmPsEmpSalaryHistory", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpNameHistory", "NewPrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmPsEmpNameHistory", "OldPrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmPsEmpNameHistory", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "CmdTypeId", "dbo.HrmPsCommandType", "CmdTypeId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "MoveId", "dbo.HrmEsMoveRequest", "ReqId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "ClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "CmdExecId", "dbo.HrmPsCommand", "CmdId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "CmdFieldId", "dbo.HrmFieldPosition", "FieldPosId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "CmdJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "CmdClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "CmdDtlsId", "dbo.HrmPsCommandDtls", "CmdDtlsId");
            AddForeignKey("dbo.HrmPsEmpPositionHistory", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpIncreases", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpGoodness", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpEnglish", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsEmpEnglish", "HrmPsEmployees_EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpEducation", "EduMajorId", "dbo.MasEduMajor", "EduMajorId");
            AddForeignKey("dbo.HrmPsEmpEducation", "EduInsId", "dbo.MasEduInstitute", "EduInsId");
            AddForeignKey("dbo.HrmPsEmpEducation", "EduQualId", "dbo.MasEduQualification", "EduQualId");
            AddForeignKey("dbo.HrmPsEmpEducation", "EduDegreeId", "dbo.MasEduDegree", "EduDegreeId");
            AddForeignKey("dbo.HrmPsEmpEducation", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpEducation", "HrmPsEmployees_EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmMpFieldSpecification", "ClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmMpFieldSpecification", "FieldPosId", "dbo.HrmFieldPosition", "FieldPosId");
            AddForeignKey("dbo.HrmMpFieldSpecificationDtls", "ClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmMpFieldSpecificationDtls", "PosTypeId", "dbo.HrmMasPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmMpFieldSpecificationDtls", "FieldSpecId", "dbo.HrmMpFieldSpecification", "FieldSpecId");
            AddForeignKey("dbo.HrmMpFieldDutyDtls", "DutyId", "dbo.HrmMpDuty", "DutyId");
            AddForeignKey("dbo.HrmMpFieldDutyDtls", "FieldDutyId", "dbo.HrmMpFieldDuty", "FieldDutyId", cascadeDelete: true);
            AddForeignKey("dbo.HrmMpFieldDuty", "ClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmMpFieldDuty", "FieldPosId", "dbo.HrmFieldPosition", "FieldPosId");
            AddForeignKey("dbo.HrmMpFieldGroup", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMpFieldPosition", "ClassSpecId", "dbo.HrmMasClassSpecification", "ClassSpecId");
            AddForeignKey("dbo.HrmMpFieldPosition", "FieldGroupId", "dbo.HrmMpFieldGroup", "FieldGroupId");
            AddForeignKey("dbo.HrmMpFieldPosition", "PosTypeId", "dbo.HrmMasPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmMpFieldPosition", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMpExecPosition", "ExecPosGroupId", "dbo.SysExecPosGroup", "ExecPosGroupId");
            AddForeignKey("dbo.HrmPsEmpSkill", "SkillTypeId", "dbo.MasSkillType", "SkillTypeId");
            AddForeignKey("dbo.HrmPsEmpSkill", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmMpPosition", "CurrencyId", "dbo.MasCurrency", "CurrencyId");
            AddForeignKey("dbo.HrmMpPosition", "SkillId", "dbo.HrmPsEmpSkill", "SkillId");
            AddForeignKey("dbo.HrmMpPosition", "PosWorkingUpperId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmMpPosition", "PosUpperId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmMpPosition", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmMpPosition", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMpPosition", "ExecPosId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmMpPosition", "FieldPosId", "dbo.HrmFieldPosition", "FieldPosId");
            AddForeignKey("dbo.HrmPsEmployeeType", "YearTypeId", "dbo.SysYearType", "YearTypeId");
            AddForeignKey("dbo.HrmEsQuitRequest", "ApprovedId", "dbo.HrmPsCommand", "CmdId");
            AddForeignKey("dbo.HrmEsQuitRequest", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEmpContact", "DistrictId", "dbo.HrmMasDistrict", "DistrictId");
            AddForeignKey("dbo.HrmPsEmpContact", "FamId", "dbo.MasFamilyhood", "FamId");
            AddForeignKey("dbo.HrmPsEmpContact", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId");
            AddForeignKey("dbo.HrmPsEmpContact", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsEmpContact", "HrmPsEmployees_EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmEsMoveRequest", "ApprovedId", "dbo.HrmPsCommand", "CmdId");
            AddForeignKey("dbo.HrmEsMoveRequest", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmTmpEmployee", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmTmpEmployee", "EntTypeId", "dbo.HrmRcEntryType", "EntTypeId");
            AddForeignKey("dbo.HrmTmpEmployee", "MarrStatId", "dbo.HrmMasMaritalStatus", "MarStatusId");
            AddForeignKey("dbo.HrmTmpEmployee", "BloodGroupId", "dbo.MasBloodGroup", "BloodGroupId");
            AddForeignKey("dbo.HrmTmpEmployee", "EmpStatusId", "dbo.HrmMasEmployeeStatus", "EmpStatusId");
            AddForeignKey("dbo.HrmTmpEmployee", "NatId", "dbo.HrmMasNationality", "NatId");
            AddForeignKey("dbo.HrmTmpEmployee", "RaceNatId", "dbo.HrmMasNationality", "NatId");
            AddForeignKey("dbo.HrmTmpEmployee", "ReligionId", "dbo.HrmMasReligion", "ReligionId");
            AddForeignKey("dbo.HrmTmpEmployee", "GenderId", "dbo.HrmMasGender", "GenderId");
            AddForeignKey("dbo.HrmTmpEmployee", "NamePrefixId", "dbo.HrmMasNationality", "NatId");
            AddForeignKey("dbo.MasEduInstitute", "MaxEduDegreeId", "dbo.MasEduDegree", "EduDegreeId");
            AddForeignKey("dbo.MasEduInstitute", "CountryId", "dbo.HrmMasCountry", "CountryId");
            AddForeignKey("dbo.MasEduInstitute", "DistrictId", "dbo.HrmMasDistrict", "DistrictId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduQualification_EduQualId", "dbo.MasEduQualification", "EduQualId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "EduInsId", "dbo.MasEduInstitute", "EduInsId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "EduMajorId", "dbo.MasEduMajor", "EduMajorId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "EduQualId", "dbo.MasEduQualification", "EduQualId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "TmpEmpId", "dbo.HrmTmpEmployee", "TmpEmpId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "HrmTmpEmployees_TmpEmpId", "dbo.HrmTmpEmployee", "TmpEmpId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "TmpEmployee_TmpEmpId", "dbo.HrmTmpEmployee", "TmpEmpId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduQualifications_EduQualId", "dbo.MasEduQualification", "EduQualId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduMajors_EduMajorId", "dbo.MasEduMajor", "EduMajorId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduMajor_EduMajorId", "dbo.MasEduMajor", "EduMajorId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduInstitutes_EduInsId", "dbo.MasEduInstitute", "EduInsId");
            AddForeignKey("dbo.HrmTmpEmployeeEducation", "MasEduInstitute_EduInsId", "dbo.MasEduInstitute", "EduInsId");
            AddForeignKey("dbo.MasEduQualification", "EduDegreeId", "dbo.MasEduDegree", "EduDegreeId");
            AddForeignKey("dbo.HrmPsEduHistory", "EduInsId", "dbo.MasEduInstitute", "EduInsId");
            AddForeignKey("dbo.HrmPsEduHistory", "EduMajorId", "dbo.MasEduMajor", "EduMajorId");
            AddForeignKey("dbo.HrmPsEduHistory", "EduQualId", "dbo.MasEduQualification", "EduQualId");
            AddForeignKey("dbo.HrmPsEduHistory", "EduDegreeId", "dbo.MasEduDegree", "EduDegreeId");
            AddForeignKey("dbo.HrmPsEduHistory", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsEduHistory", "HrmPsEmployees_EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmMpPositionType", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMpPositionType", "HrmPsEmployeeTypes_EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMpClass", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMpClass", "PosTypeId", "dbo.HrmMpPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmPsCommandDtls", "CurrencyId", "dbo.MasCurrency", "CurrencyId");
            AddForeignKey("dbo.HrmPsCommandDtls", "TmpEduId", "dbo.HrmTmpEmployeeEducation", "TmpEduId");
            AddForeignKey("dbo.HrmPsCommandDtls", "TmpEmpId", "dbo.HrmTmpEmployee", "TmpEmpId");
            AddForeignKey("dbo.HrmPsCommandDtls", "EntClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmPsCommandDtls", "EntPosTypeId", "dbo.HrmMasPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmPsCommandDtls", "NewExecPosId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "NewPosTypeId", "dbo.HrmMasPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmPsCommandDtls", "NewWorkingJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "NewJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "NewClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmPsCommandDtls", "NewPosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "OldExecPosId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "OldPosTypeId", "dbo.HrmMasPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmPsCommandDtls", "OldWorkingJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "OldJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "OldClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmPsCommandDtls", "OldPosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "MoveId", "dbo.HrmEsMoveRequest", "ReqId");
            AddForeignKey("dbo.HrmPsCommandDtls", "EduHisId", "dbo.HrmPsEduHistory", "EduHisId");
            AddForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpExecPositions_ExecPosId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "new_working_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpClasses_ClassId", "dbo.HrmMpClass", "ClassId");
            AddForeignKey("dbo.HrmPsCommandDtls", "new_HrmMpPositions_PosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpExecPositions_ExecPosId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "old_working_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpJobSites_JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpClasses_ClassId", "dbo.HrmMpClass", "ClassId");
            AddForeignKey("dbo.HrmPsCommandDtls", "old_HrmMpPositions_PosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPsCommandDtls", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsCommandDtls", "CmdId", "dbo.HrmPsCommand", "CmdId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsCommandType", "CmdGroupId", "dbo.HrmPsCommandGroup", "CmdGroupId");
            AddForeignKey("dbo.HrmPsCommandType", "HrmPsCommandGroups_CmdGroupId", "dbo.HrmPsCommandGroup", "CmdGroupId");
            AddForeignKey("dbo.HrmPsCommand", "ApprovedId", "dbo.HrmPsCommand", "CmdId");
            AddForeignKey("dbo.HrmPsCommand", "PenaltyId", "dbo.HrmDcPenalty", "PenId");
            AddForeignKey("dbo.HrmPsCommand", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommand", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsCommand", "CmdTypeId", "dbo.HrmPsCommandType", "CmdTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPsCommand", "HrmDcPenalty_PenId", "dbo.HrmDcPenalty", "PenId");
            AddForeignKey("dbo.HrmPsCommand", "approver_EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.HrmPsCommand", "HrmMpJobSites_JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPsCommand", "HrmPsEmployeeTypes_EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmPsCommand", "HrmPsCommandTypes_CmdTypeId", "dbo.HrmPsCommandType", "CmdTypeId");
            AddForeignKey("dbo.SysPermission", "RoleId", "dbo.SysRole", "RoleId", cascadeDelete: true);
            AddForeignKey("dbo.SysUserRole", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.SysUserRole", "RoleId", "dbo.SysRole", "RoleId", cascadeDelete: true);
            AddForeignKey("dbo.SysUserRole", "PosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.SysUserRole", "UserId", "dbo.SysUser", "UserId", cascadeDelete: true);
            AddForeignKey("dbo.SysMessage", "ToEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.SysMessage", "FromEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.SysUser", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmPurchaseOrderItem", "BidderQuoId", "dbo.IcmBidderQuotation", "BidderQuoId");
            AddForeignKey("dbo.IcmPurchaseOrderItem", "PoId", "dbo.IcmPurchaseOrder", "PoId", cascadeDelete: true);
            AddForeignKey("dbo.IcmDeliveryNoteItemExtra", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmDeliveryNoteItemExtra", "DnId", "dbo.IcmDeliveryNote", "DnId");
            AddForeignKey("dbo.IcmMovementHistory", "AssetId", "dbo.IcmAsset", "AssetId", cascadeDelete: true);
            AddForeignKey("dbo.IcmFile", "Employee_EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmFile", "RefType", "dbo.IcmMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmCommittee", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmCommittee", "RefType", "dbo.IcmMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmCommittee", "ComTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmCommittee", "ComPositionId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmCommittee", "ComFunctionId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmMovementDtl", "AssetId", "dbo.IcmAsset", "AssetId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMovementDtl", "MovementId", "dbo.IcmMovement", "MovementId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMovement", "SourceJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.IcmMovement", "DestinationWarehouseId", "dbo.IcmWarehouse", "WhId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMovement", "SourceWarehouseId", "dbo.IcmWarehouse", "WhId");
            AddForeignKey("dbo.IcmMovement", "ResTypeId", "dbo.IcmMasResourceType", "ResTypeId", cascadeDelete: true);
            AddForeignKey("dbo.IcmDispenseHistory", "DispenseId", "dbo.IcmDispense", "DispenseId", cascadeDelete: true);
            AddForeignKey("dbo.IcmDispenseHistory", "WhId", "dbo.IcmWarehouse", "WhId");
            AddForeignKey("dbo.IcmDispenseHistory", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmDispense", "ProjectId", "dbo.bgm_project", "bgm_proj_seq", cascadeDelete: true);
            AddForeignKey("dbo.IcmDispense", "RequestParcelId", "dbo.IcmRequestParcel", "ReqParcelId", cascadeDelete: true);
            AddForeignKey("dbo.IcmDispense", "RequestById", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmDispense", "FromJobSiteId", "dbo.HrmJobSite", "JobSiteId", cascadeDelete: true);
            AddForeignKey("dbo.IcmDispense", "WhId", "dbo.IcmWarehouse", "WhId");
            AddForeignKey("dbo.IcmRequestParcelDtl", "JobsiteId", "dbo.HrmJobSite", "JobSiteId", cascadeDelete: true);
            AddForeignKey("dbo.IcmRequestParcelDtl", "PprId", "dbo.IcmPrePurchaseRequest", "PprId");
            AddForeignKey("dbo.IcmRequestParcelDtl", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmRequestParcelDtl", "ReqId", "dbo.IcmRequestParcel", "ReqParcelId");
            AddForeignKey("dbo.IcmRequestParcel", "ProjectId", "dbo.bgm_project", "bgm_proj_seq", cascadeDelete: true);
            AddForeignKey("dbo.IcmRequestParcel", "IcmResTypeId", "dbo.IcmMasResourceType", "ResTypeId");
            AddForeignKey("dbo.IcmRequestParcel", "WarehousePermitId", "dbo.IcmWarehousePermit", "WarehousePermitId", cascadeDelete: true);
            AddForeignKey("dbo.IcmRequestParcel", "RequestBy", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmRequestParcel", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.IcmOfficeSuppliesLot", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmOfficeSuppliesLot", "ProjExpId", "dbo.bgm_project_expense", "bgm_proj_exp_seq");
            AddForeignKey("dbo.IcmOfficeSuppliesLot", "UnitId", "dbo.IcmMasUnit", "UnitId");
            AddForeignKey("dbo.IcmOfficeSuppliesLot", "WhId", "dbo.IcmWarehouse", "WhId");
            AddForeignKey("dbo.IcmOfficeSuppliesLot", "ReceiveDtlId", "dbo.IcmReceiveDtl", "ReceiveDtlId");
            AddForeignKey("dbo.IcmAssetWarranty", "AssetId", "dbo.IcmAsset", "AssetId", cascadeDelete: true);
            AddForeignKey("dbo.IcmAsset", "DepreciationTypeId", "dbo.IcmMasDepreciationType", "DpTypeId");
            AddForeignKey("dbo.IcmAsset", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.IcmAsset", "AssetStatusId", "dbo.IcmMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmAsset", "ResGrpId", "dbo.IcmMasResourceGroup", "ResGrpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmAsset", "ResSubGrpId", "dbo.IcmMasResourceSubGroup", "ResSubGrpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmAsset", "UnitId", "dbo.IcmMasUnit", "UnitId", cascadeDelete: true);
            AddForeignKey("dbo.IcmAsset", "WhId", "dbo.IcmWarehouse", "WhId", cascadeDelete: true);
            AddForeignKey("dbo.IcmAsset", "AssetTypeId", "dbo.IcmMasResourceType", "ResTypeId");
            AddForeignKey("dbo.IcmAsset", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId", cascadeDelete: true);
            AddForeignKey("dbo.IcmAsset", "ProjExpId", "dbo.bgm_project_expense", "bgm_proj_exp_seq");
            AddForeignKey("dbo.IcmAsset", "ReceiveDtlId", "dbo.IcmReceiveDtl", "ReceiveDtlId", cascadeDelete: true);
            AddForeignKey("dbo.IcmReceiveDtl", "DepreciationTypeId", "dbo.IcmMasDepreciationType", "DpTypeId");
            AddForeignKey("dbo.IcmReceiveDtl", "ProjExpId", "dbo.bgm_project_expense", "bgm_proj_exp_seq");
            AddForeignKey("dbo.IcmReceiveDtl", "UnitId", "dbo.IcmMasUnit", "UnitId");
            AddForeignKey("dbo.IcmReceiveDtl", "ResourceTypeId", "dbo.IcmMasResourceType", "ResTypeId");
            AddForeignKey("dbo.IcmReceiveDtl", "ResourceItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmReceiveDtl", "ReceiveId", "dbo.IcmReceive", "ReceiveId");
            AddForeignKey("dbo.IcmWarehousePermit", "JobSiteId", "dbo.HrmJobSite", "JobSiteId", cascadeDelete: true);
            AddForeignKey("dbo.IcmWarehousePermit", "WhId", "dbo.IcmWarehouse", "WhId", cascadeDelete: true);
            AddForeignKey("dbo.IcmReceive", "ReceiveTypeId", "dbo.IcmMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmReceive", "DnId", "dbo.IcmDeliveryNote", "DnId");
            AddForeignKey("dbo.IcmReceive", "WhId", "dbo.IcmWarehouse", "WhId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMasContactPartner", "ConId", "dbo.IcmMasContact", "ConId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMasContactBank", "BranchId", "dbo.FimMasBankBranch", "BranchId");
            AddForeignKey("dbo.IcmMasContactBank", "ConId", "dbo.IcmMasContact", "ConId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMasPurchaseRegularMapping", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq", cascadeDelete: true);
            AddForeignKey("dbo.IcmMasPurchaseRegularMapping", "RegularId", "dbo.IcmMasPurchaseRegular", "RegularId", cascadeDelete: true);
            AddForeignKey("dbo.FimMasFund", "ConId", "dbo.IcmMasContact", "ConId");
            AddForeignKey("dbo.FimEmployeeTax", "FundTypeId", "dbo.FimMasFund", "FundId");
            AddForeignKey("dbo.FimEmployeeTax", "EmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPurchaseOrderPenalty", "RateTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseOrderPenalty", "PoId", "dbo.IcmPurchaseOrder", "PoId");
            AddForeignKey("dbo.IcmDeliveryNotePenalty", "PoPenId", "dbo.IcmPurchaseOrderPenalty", "PoPenId");
            AddForeignKey("dbo.IcmDeliveryNotePenalty", "DnId", "dbo.IcmDeliveryNote", "DnId");
            AddForeignKey("dbo.FimReceive", "PayId", "dbo.FimPay", "PayId");
            AddForeignKey("dbo.FimReceive", "PayReqId", "dbo.FimPayRequest", "PayReqId");
            AddForeignKey("dbo.FimReceive", "PetitionId", "dbo.FimPetition", "PetitionId");
            AddForeignKey("dbo.FimReceive", "TransferId", "dbo.FimTransfer", "TransferId");
            AddForeignKey("dbo.FimReceive", "TranGrpId", "dbo.AcmTransectionGroup", "TranGrpId");
            AddForeignKey("dbo.FimReceive", "PoInstalId", "dbo.IcmPurchaseOrderInstallment", "PoInstallId");
            AddForeignKey("dbo.FimReceive", "DnPenId", "dbo.IcmDeliveryNotePenalty", "DnPenId");
            AddForeignKey("dbo.FimReceive", "PrePayColId", "dbo.IcmBidderCollateral", "BidderColId");
            AddForeignKey("dbo.FimReceive", "PoColId", "dbo.IcmBidderCollateral", "BidderColId");
            AddForeignKey("dbo.FimReceive", "BidOfferColId", "dbo.IcmBidderCollateral", "BidderColId");
            AddForeignKey("dbo.FimReceive", "BidderId", "dbo.IcmBidder", "BidderId");
            AddForeignKey("dbo.FimReceive", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.FimReceive", "ContactId", "dbo.IcmMasContact", "ConId");
            AddForeignKey("dbo.FimReceive", "BankAccId", "dbo.FimMasBankAccount", "BankAccId");
            AddForeignKey("dbo.FimReceive", "BranchId", "dbo.FimMasBankBranch", "BranchId");
            AddForeignKey("dbo.FimReceive", "ReceiveMethodId", "dbo.FimMasLookUp", "LookUpId");
            AddForeignKey("dbo.FimReceive", "ReceiveTypeId", "dbo.FimMasReceiveType", "ReceiveTypeId");
            AddForeignKey("dbo.FimReceive", "WorkAreaId", "dbo.HrmMasWorkArea", "WorkAreaId");
            AddForeignKey("dbo.FimReceive", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq", cascadeDelete: true);
            AddForeignKey("dbo.FimPayCheque", "ChequeId", "dbo.FimCheque", "ChequeId", cascadeDelete: true);
            AddForeignKey("dbo.FimPayCheque", "PayId", "dbo.FimPay", "PayId", cascadeDelete: true);
            AddForeignKey("dbo.FimPayRequestDtlRate", "PayRequestDtlId", "dbo.FimPayRequestDtl", "PayReqDtlId");
            AddForeignKey("dbo.FimCheque", "ChequeBookId", "dbo.FimChequeBook", "ChequeBookId", cascadeDelete: true);
            AddForeignKey("dbo.FimChequeBook", "BankAccId", "dbo.FimMasBankAccount", "BankAccId", cascadeDelete: true);
            AddForeignKey("dbo.FimMasBorrowType", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.FimMasReceiveType", "AccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.FimMasReceiveType", "BankAccId", "dbo.FimMasBankAccount", "BankAccId");
            AddForeignKey("dbo.FimMasReceiveType", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq", cascadeDelete: true);
            AddForeignKey("dbo.FimMasExpenseRate", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.FimMasExpenseRate", "BgExpId", "dbo.bgm_mas_expense", "bgm_exp_seq");
            AddForeignKey("dbo.bgm_strategy_data_list", "bgm_strat_type_seq", "dbo.bgm_mas_strategy_type", "bgm_strat_type_seq");
            AddForeignKey("dbo.IcmBidderCollateral", "BidderId", "dbo.IcmBidder", "BidderId");
            AddForeignKey("dbo.IcmBidderCollateral", "ColCategoryId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmBidderCollateral", "ColStatusId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmBidderCollateral", "ColTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.FimPay", "TranGrpId", "dbo.AcmTransectionGroup", "TranGrpId");
            AddForeignKey("dbo.FimPay", "PostPayId", "dbo.FimPay", "PayId");
            AddForeignKey("dbo.FimPay", "BidderColId", "dbo.IcmBidderCollateral", "BidderColId");
            AddForeignKey("dbo.FimPay", "ContactId", "dbo.IcmMasContact", "ConId");
            AddForeignKey("dbo.FimPay", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.FimPay", "PetitionDtlId", "dbo.FimPetitionDtl", "PetitionDtlId");
            AddForeignKey("dbo.FimPay", "PetitionId", "dbo.FimPetition", "PetitionId");
            AddForeignKey("dbo.FimPay", "PayReqId", "dbo.FimPayRequest", "PayReqId");
            AddForeignKey("dbo.FimPay", "PayMethodId", "dbo.FimMasLookUp", "LookUpId");
            AddForeignKey("dbo.FimPay", "PayEventId", "dbo.FimMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.FimPay", "WorkAreaId", "dbo.HrmMasWorkArea", "WorkAreaId", cascadeDelete: true);
            AddForeignKey("dbo.FimPay", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq", cascadeDelete: true);
            AddForeignKey("dbo.FimPetition", "TranGrpId", "dbo.AcmTransectionGroup", "TranGrpId");
            AddForeignKey("dbo.FimPetition", "PetitionTypeId", "dbo.FimMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.FimPetition", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq", cascadeDelete: true);
            AddForeignKey("dbo.FimPetitionDtl", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.FimPetitionDtl", "PayReqId", "dbo.FimPayRequest", "PayReqId");
            AddForeignKey("dbo.FimPetitionDtl", "PetitionId", "dbo.FimPetition", "PetitionId");
            AddForeignKey("dbo.FimReturn", "TranGrpId", "dbo.AcmTransectionGroup", "TranGrpId");
            AddForeignKey("dbo.FimReturn", "PayReqId", "dbo.FimPayRequest", "PayReqId");
            AddForeignKey("dbo.FimReturnDtl", "PayReqDtlId", "dbo.FimPayRequestDtl", "PayReqDtlId");
            AddForeignKey("dbo.FimReturnDtl", "ReturnId", "dbo.FimReturn", "ReturnId");
            AddForeignKey("dbo.FimPayRequest", "TranGrpId", "dbo.AcmTransectionGroup", "TranGrpId");
            AddForeignKey("dbo.FimPayRequest", "DebtorContactId", "dbo.IcmMasContact", "ConId");
            AddForeignKey("dbo.FimPayRequest", "DebtorEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.FimPayRequest", "BorrowTypeId", "dbo.FimMasLookUp", "LookUpId");
            AddForeignKey("dbo.FimPayRequest", "DnId", "dbo.IcmDeliveryNote", "DnId");
            AddForeignKey("dbo.FimPayRequest", "ContactId", "dbo.IcmMasContact", "ConId");
            AddForeignKey("dbo.FimPayRequest", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.FimPayRequest", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.FimPayRequest", "ProjOperId", "dbo.bgm_project_operation", "bgm_proj_oper_seq");
            AddForeignKey("dbo.FimPayRequest", "AdvanceBgSourceId", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.FimPayRequest", "PayEventId", "dbo.FimMasLookUp", "LookUpId");
            AddForeignKey("dbo.FimPayRequest", "ExpGrpId", "dbo.bgm_mas_expense_group", "bgm_exp_grp_seq");
            AddForeignKey("dbo.FimPayRequest", "WorkAreaId", "dbo.HrmMasWorkArea", "WorkAreaId");
            AddForeignKey("dbo.FimPayRequest", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq", cascadeDelete: true);
            AddForeignKey("dbo.FimPayRequestDtl", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.FimPayRequestDtl", "ProjOperExpId", "dbo.bgm_project_operation_expense", "bgm_proj_oper_exp_seq");
            AddForeignKey("dbo.FimPayRequestDtl", "PayReqId", "dbo.FimPayRequest", "PayReqId", cascadeDelete: true);
            AddForeignKey("dbo.IcmWarehouse", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.IcmWarehouse", "ScopeId", "dbo.IcmMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmDeliveryNote", "TranGrpId", "dbo.AcmTransectionGroup", "TranGrpId");
            AddForeignKey("dbo.IcmDeliveryNote", "ProgId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmDeliveryNote", "DeliveryJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.IcmDeliveryNote", "DeliveryEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmDeliveryNote", "YearTypeId", "dbo.SysYearType", "YearTypeId");
            AddForeignKey("dbo.IcmDeliveryNote", "WhId", "dbo.IcmWarehouse", "WhId");
            AddForeignKey("dbo.IcmDeliveryNote", "PoInstallId", "dbo.IcmPurchaseOrderInstallment", "PoInstallId");
            AddForeignKey("dbo.IcmDeliveryNote", "PoId", "dbo.IcmPurchaseOrder", "PoId");
            AddForeignKey("dbo.IcmDeliveryNote", "ProjOperExpId", "dbo.bgm_project_operation_expense", "bgm_proj_oper_exp_seq");
            AddForeignKey("dbo.IcmDeliveryNoteItem", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmDeliveryNoteItem", "PoInstallItemId", "dbo.IcmPurchaseOrderInstallmentItem", "PoInstallItemId");
            AddForeignKey("dbo.IcmDeliveryNoteItem", "DnId", "dbo.IcmDeliveryNote", "DnId");
            AddForeignKey("dbo.IcmPurchaseOrder", "YearTypeId", "dbo.SysYearType", "YearTypeId");
            AddForeignKey("dbo.IcmPurchaseOrder", "ProgressId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseOrder", "DurTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseOrder", "PcTypeId", "dbo.IcmMasPurchaseType", "PcTypeId");
            AddForeignKey("dbo.IcmPurchaseOrder", "BidderId", "dbo.IcmBidder", "BidderId");
            AddForeignKey("dbo.IcmPurchaseOrderInstallment", "DurTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseOrderInstallment", "PoId", "dbo.IcmPurchaseOrder", "PoId");
            AddForeignKey("dbo.IcmBid", "CancelEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmBid", "ConfirmEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmBid", "BidJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.IcmBid", "BidEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmBid", "YearTypeId", "dbo.SysYearType", "YearTypeId");
            AddForeignKey("dbo.IcmBid", "PrId", "dbo.IcmPurchaseRequest", "PrId", cascadeDelete: true);
            AddForeignKey("dbo.IcmBidder", "VatTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmBidder", "DurTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmBidder", "PrId", "dbo.IcmPurchaseRequest", "PrId");
            AddForeignKey("dbo.IcmBidder", "BidId", "dbo.IcmBid", "BidId");
            AddForeignKey("dbo.IcmBidder", "ConId", "dbo.IcmMasContact", "ConId", cascadeDelete: true);
            AddForeignKey("dbo.IcmBidderQuotation", "PrItemId", "dbo.IcmPurchaseRequestItem", "PrItemId");
            AddForeignKey("dbo.IcmBidderQuotation", "BidderId", "dbo.IcmBidder", "BidderId");
            AddForeignKey("dbo.IcmPurchaseOrderInstallmentItem", "PoInstallId", "dbo.IcmPurchaseOrderInstallment", "PoInstallId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPurchaseOrderInstallmentItem", "BidderQuoId", "dbo.IcmBidderQuotation", "BidderQuoId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMasPurchaseMethod", "PcTypeId", "dbo.IcmMasPurchaseType", "PcTypeId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPurchaseRequest", "ProgressId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseRequest", "DurCountId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseRequest", "DurTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseRequest", "PriorityId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPurchaseRequest", "CancelEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmPurchaseRequest", "ConfirmEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmPurchaseRequest", "PurchaseJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.IcmPurchaseRequest", "PurchaseEmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.IcmPurchaseRequest", "YearTypeId", "dbo.SysYearType", "YearTypeId");
            AddForeignKey("dbo.IcmPurchaseRequest", "PcMethodId", "dbo.IcmMasPurchaseMethod", "PcMethodId");
            AddForeignKey("dbo.IcmPurchaseRequest", "PcTypeId", "dbo.IcmMasPurchaseType", "PcTypeId");
            AddForeignKey("dbo.IcmPurchaseRequest", "RegularId", "dbo.IcmMasPurchaseRegular", "RegularId");
            AddForeignKey("dbo.IcmPurchaseRequestItem", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmPurchaseRequestItem", "BgExpId", "dbo.bgm_mas_expense", "bgm_exp_seq", cascadeDelete: true);
            AddForeignKey("dbo.IcmPurchaseRequestItem", "PrId", "dbo.IcmPurchaseRequest", "PrId");
            AddForeignKey("dbo.IcmPrePurchaseRequest", "ProgressId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPrePurchaseRequest", "DurCountId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPrePurchaseRequest", "DurTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmPrePurchaseRequest", "PriorityId", "dbo.IcmMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPrePurchaseRequest", "RequestJobSiteId", "dbo.HrmJobSite", "JobSiteId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPrePurchaseRequest", "RequestEmpId", "dbo.HrmEmployee", "EmpId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPrePurchaseRequest", "YearTypeId", "dbo.SysYearType", "YearTypeId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPrePurchaseRequest", "PcTypeId", "dbo.IcmMasPurchaseType", "PcTypeId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPrePurchaseRequestItem", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.IcmPrePurchaseRequestItem", "BgExpId", "dbo.bgm_mas_expense", "bgm_exp_seq");
            AddForeignKey("dbo.IcmPrePurchaseRequestItem", "PrItemId", "dbo.IcmPurchaseRequestItem", "PrItemId");
            AddForeignKey("dbo.IcmPrePurchaseRequestItem", "PprId", "dbo.IcmPrePurchaseRequest", "PprId", cascadeDelete: true);
            AddForeignKey("dbo.IcmPrePurchaseRequestItem", "ResItemId", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.IcmPrePurchaseRequestItem", "RegularId", "dbo.IcmMasPurchaseRegular", "RegularId");
            AddForeignKey("dbo.IcmPrePurchaseRequestItem", "ProjOperExpId", "dbo.bgm_project_operation_expense", "bgm_proj_oper_exp_seq");
            AddForeignKey("dbo.bgm_project_operation_report", "pay_seq", "dbo.FimPay", "PayId");
            AddForeignKey("dbo.bgm_project_operation_report", "petition_dtls_seq", "dbo.FimPetitionDtl", "PetitionDtlId");
            AddForeignKey("dbo.bgm_project_operation_report", "return_dtls_seq", "dbo.FimReturnDtl", "ReturnDtlId");
            AddForeignKey("dbo.bgm_project_operation_report", "money_req_dtls_seq", "dbo.FimPayRequestDtl", "PayReqDtlId");
            AddForeignKey("dbo.bgm_project_operation_report", "icm_dn_item_seq", "dbo.IcmDeliveryNoteItem", "DnItemId");
            AddForeignKey("dbo.bgm_project_operation_report", "icm_po_install_item_seq", "dbo.IcmPurchaseOrderInstallmentItem", "PoInstallItemId");
            AddForeignKey("dbo.bgm_project_operation_report", "icm_pr_item_seq", "dbo.IcmPurchaseRequestItem", "PrItemId");
            AddForeignKey("dbo.bgm_project_operation_report", "icm_ppr_item_seq", "dbo.IcmPrePurchaseRequestItem", "PprItemId");
            AddForeignKey("dbo.bgm_project_operation_report", "bgm_proj_oper_exp_seq", "dbo.bgm_project_operation_expense", "bgm_proj_oper_exp_seq");
            AddForeignKey("dbo.IcmMasLookUp", "LookUpTypeId", "dbo.IcmMasLookUpType", "LookUpTypeId", cascadeDelete: true);
            AddForeignKey("dbo.IcmMasContact", "VatTypeId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmMasContact", "ConStatusId", "dbo.IcmMasLookUp", "LookUpId");
            AddForeignKey("dbo.IcmMasContact", "ConGrpId", "dbo.IcmMasLookUp", "LookUpId", cascadeDelete: true);
            AddForeignKey("dbo.bgm_project_operation_person", "ContactId", "dbo.IcmMasContact", "ConId");
            AddForeignKey("dbo.bgm_project_operation_person", "emp_seq", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.bgm_project_operation_person", "bgm_proj_oper_seq", "dbo.bgm_project_operation", "bgm_proj_oper_seq");
            AddForeignKey("dbo.bgm_project_operation", "job_site_seq", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.bgm_project_operation", "emp_seq", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.bgm_project_operation", "bgm_proj_seq", "dbo.bgm_project", "bgm_proj_seq");
            AddForeignKey("dbo.bgm_project_operation_expense", "bgm_proj_exp_seq", "dbo.bgm_project_expense", "bgm_proj_exp_seq");
            AddForeignKey("dbo.bgm_project_operation_expense", "bgm_proj_oper_seq", "dbo.bgm_project_operation", "bgm_proj_oper_seq");
            AddForeignKey("dbo.bgm_project_report", "bgm_proj_oper_exp_seq", "dbo.bgm_project_operation_expense", "bgm_proj_oper_exp_seq");
            AddForeignKey("dbo.bgm_project_report", "bgm_proj_exp_seq", "dbo.bgm_project_expense", "bgm_proj_exp_seq");
            AddForeignKey("dbo.bgm_mas_option", "bgm_option_type_seq", "dbo.bgm_system_option_type", "bgm_option_type_seq");
            AddForeignKey("dbo.bgm_mas_option", "job_site_seq", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.bgm_mas_option", "upper_bgm_option_seq", "dbo.bgm_mas_option", "bgm_option_seq");
            AddForeignKey("dbo.bgm_project_option", "bgm_proj_seq", "dbo.bgm_project", "bgm_proj_seq");
            AddForeignKey("dbo.bgm_project_option", "bgm_option_seq", "dbo.bgm_mas_option", "bgm_option_seq");
            AddForeignKey("dbo.bgm_project_manager", "emp_seq", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.bgm_project_manager", "bgm_proj_seq", "dbo.bgm_project", "bgm_proj_seq");
            AddForeignKey("dbo.bgm_project_activity_plan", "bgm_proj_seq", "dbo.bgm_project", "bgm_proj_seq");
            AddForeignKey("dbo.IcmMasResourceGroup", "CumdepreAccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.IcmMasResourceGroup", "ConsumeAccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.IcmMasResourceGroup", "BreakAccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.IcmMasResourceGroup", "DepreAccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.IcmMasResourceGroup", "AssetAccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.IcmMasResourceGroup", "DpTypeId", "dbo.IcmMasDepreciationType", "DpTypeId");
            AddForeignKey("dbo.IcmMasResourceGroup", "ResTypeId", "dbo.IcmMasResourceType", "ResTypeId");
            AddForeignKey("dbo.IcmMasResourceSubGroup", "DpTypeId", "dbo.IcmMasDepreciationType", "DpTypeId");
            AddForeignKey("dbo.IcmMasResourceSubGroup", "ResGrpId", "dbo.IcmMasResourceGroup", "ResGrpId");
            AddForeignKey("dbo.IcmMasResourceItem", "UnitId", "dbo.IcmMasUnit", "UnitId");
            AddForeignKey("dbo.IcmMasResourceItem", "ResSubGrpId", "dbo.IcmMasResourceSubGroup", "ResSubGrpId");
            AddForeignKey("dbo.bgm_project_expense", "icm_res_item_seq", "dbo.IcmMasResourceItem", "ResItemId");
            AddForeignKey("dbo.bgm_project_expense", "bgm_exp_seq", "dbo.bgm_mas_expense", "bgm_exp_seq");
            AddForeignKey("dbo.bgm_project_expense", "bgm_source_seq", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.bgm_project_expense", "bgm_proj_seq", "dbo.bgm_project", "bgm_proj_seq");
            AddForeignKey("dbo.bgm_mas_expense_source", "bgm_source_seq", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.bgm_mas_expense_source", "bgm_exp_seq", "dbo.bgm_mas_expense", "bgm_exp_seq");
            AddForeignKey("dbo.bgm_mas_expense", "account_seq", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.bgm_mas_expense", "bgm_exp_grp_id_real", "dbo.bgm_mas_expense_group", "bgm_exp_grp_seq");
            AddForeignKey("dbo.bgm_mas_expense", "bgm_exp_grp_seq", "dbo.bgm_mas_expense_group", "bgm_exp_grp_seq");
            AddForeignKey("dbo.bgm_mas_expense", "upper_bgm_exp_seq", "dbo.bgm_mas_expense", "bgm_exp_seq");
            AddForeignKey("dbo.AcmTransectionDtl", "AccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.AcmTransectionDtl", "TranId", "dbo.AcmTransection", "TranId");
            AddForeignKey("dbo.HrmFieldPosition", "ClassSpecId", "dbo.HrmMasClassSpecification", "ClassSpecId");
            AddForeignKey("dbo.HrmFieldPosition", "PosTypeId", "dbo.HrmMasPositionType", "PosTypeId");
            AddForeignKey("dbo.HrmFieldPosition", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMasCity", "CountryId", "dbo.HrmMasCountry", "CountryId");
            AddForeignKey("dbo.HrmMasAmphur", "ProvinceId", "dbo.HrmMasProvince", "ProvinceId");
            AddForeignKey("dbo.HrmMasDistrict", "AmphurId", "dbo.HrmMasAmphur", "AmphurId");
            AddForeignKey("dbo.HrmMasJobSiteType", "CurrentJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmJobSite", "MpJobSiteType_JobSiteTypeId", "dbo.HrmMpJobSiteType", "JobSiteTypeId");
            AddForeignKey("dbo.HrmJobSite", "JobSite_JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmJobSite", "JobSiteStatusId", "dbo.HrmMasJobSiteStatus", "JobSiteStatusId");
            AddForeignKey("dbo.HrmJobSite", "CountryId", "dbo.HrmMasCountry", "CountryId");
            AddForeignKey("dbo.HrmJobSite", "CityId", "dbo.HrmMasCity", "CityId");
            AddForeignKey("dbo.HrmJobSite", "ProvnceId", "dbo.HrmMasProvince", "ProvinceId");
            AddForeignKey("dbo.HrmJobSite", "DistrictId", "dbo.HrmMasDistrict", "DistrictId");
            AddForeignKey("dbo.HrmJobSite", "JobSiteLevelId", "dbo.HrmMasJobSiteLevel", "JobSiteLevelId");
            AddForeignKey("dbo.HrmJobSite", "WorkAreaId", "dbo.HrmMasWorkArea", "WorkAreaId");
            AddForeignKey("dbo.HrmJobSite", "JobSiteTypeId", "dbo.HrmMasJobSiteType", "JobSiteTypeId");
            AddForeignKey("dbo.HrmJobSite", "UpperJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPosition", "Position_PosId1", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPosition", "Position_PosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPosition", "PosStatusId", "dbo.HrmMasPositionStatus", "PosStatusId", cascadeDelete: true);
            AddForeignKey("dbo.HrmPosition", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmPosition", "ExecPosId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmPosition", "FieldPosId", "dbo.HrmFieldPosition", "FieldPosId");
            AddForeignKey("dbo.HrmPosition", "JobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmPosition", "WorkingUpperPosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmPosition", "UpperPosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmMasPositionType", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmMasClass", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmMasClass", "PosTypeId", "dbo.HrmMasPositionType", "PosTypeId", cascadeDelete: true);
            AddForeignKey("dbo.HrmMasEmployeeType", "YearTypeId", "dbo.SysYearType", "YearTypeId");
            AddForeignKey("dbo.HrmMasNamePrefix", "GenderId", "dbo.HrmMasGender", "GenderId");
            AddForeignKey("dbo.HrmEmployee", "MaritalStatusId", "dbo.HrmMasMaritalStatus", "MarStatusId");
            AddForeignKey("dbo.HrmEmployee", "ExecPosId", "dbo.HrmExecutivePosition", "ExecPosId");
            AddForeignKey("dbo.HrmEmployee", "EmpStatusId", "dbo.HrmMasEmployeeStatus", "EmpStatusId");
            AddForeignKey("dbo.HrmEmployee", "WorkingJobSiteId", "dbo.HrmJobSite", "JobSiteId");
            AddForeignKey("dbo.HrmEmployee", "PosId", "dbo.HrmPosition", "PosId");
            AddForeignKey("dbo.HrmEmployee", "ClassId", "dbo.HrmMasClass", "ClassId");
            AddForeignKey("dbo.HrmEmployee", "EmpTypeId", "dbo.HrmMasEmployeeType", "EmpTypeId");
            AddForeignKey("dbo.HrmEmployee", "NationalId", "dbo.HrmMasNationality", "NatId");
            AddForeignKey("dbo.HrmEmployee", "RaceNationalId", "dbo.HrmMasNationality", "NatId");
            AddForeignKey("dbo.HrmEmployee", "ReligionId", "dbo.HrmMasReligion", "ReligionId");
            AddForeignKey("dbo.HrmEmployee", "GenderId", "dbo.HrmMasGender", "GenderId", cascadeDelete: true);
            AddForeignKey("dbo.HrmEmployee", "NamePrefixId", "dbo.HrmMasNamePrefix", "NamePrefixId", cascadeDelete: true);
            AddForeignKey("dbo.FimMasLookUp", "LookUpTypeId", "dbo.FimMasLookUpType", "LookUpTypeId", cascadeDelete: true);
            AddForeignKey("dbo.FimMasBankBranch", "BankId", "dbo.FimMasBank", "BankId", cascadeDelete: true);
            AddForeignKey("dbo.FimMasBankAccount", "WorkAreaId", "dbo.HrmMasWorkArea", "WorkAreaId");
            AddForeignKey("dbo.FimMasBankAccount", "AccountId", "dbo.AcmMasAccount", "AccountId");
            AddForeignKey("dbo.FimMasBankAccount", "BankAccTypeId", "dbo.FimMasLookUp", "LookUpId");
            AddForeignKey("dbo.FimMasBankAccount", "SavingBankAccId", "dbo.FimMasBankAccount", "BankAccId");
            AddForeignKey("dbo.FimMasBankAccount", "BgmSourceId", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.FimMasBankAccount", "BranchId", "dbo.FimMasBankBranch", "BranchId");
            AddForeignKey("dbo.HrmMasScope", "MasScope_ScopeId", "dbo.HrmMasScope", "ScopeId");
            AddForeignKey("dbo.HrmMasWorkArea", "ScopeId", "dbo.HrmMasScope", "ScopeId");
            AddForeignKey("dbo.bgm_mas_source", "bgm_year_type_seq", "dbo.SysYearType", "YearTypeId");
            AddForeignKey("dbo.bgm_mas_source", "bgm_source_type_seq", "dbo.bgm_mas_source_type", "bgm_source_type_seq");
            AddForeignKey("dbo.bgm_mas_source", "upper_bgm_source_seq", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.FimTransfer", "EmpId", "dbo.HrmEmployee", "EmpId");
            AddForeignKey("dbo.FimTransfer", "ToBankAccId", "dbo.FimMasBankAccount", "BankAccId");
            AddForeignKey("dbo.FimTransfer", "FromBankAccId", "dbo.FimMasBankAccount", "BankAccId");
            AddForeignKey("dbo.FimTransfer", "WorkAreaId", "dbo.HrmMasWorkArea", "WorkAreaId", cascadeDelete: true);
            AddForeignKey("dbo.FimTransfer", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq", cascadeDelete: true);
            AddForeignKey("dbo.AcmTransection", "BgSourceId", "dbo.bgm_mas_source", "bgm_source_seq");
            AddForeignKey("dbo.AcmTransection", "WorkAreaId", "dbo.HrmMasWorkArea", "WorkAreaId");
            AddForeignKey("dbo.AcmTransection", "TransferId", "dbo.FimTransfer", "TransferId");
            AddForeignKey("dbo.AcmMasAccount", "VersionId", "dbo.AcmMasAccountVersion", "VersionId");
            AddForeignKey("dbo.AcmMasAccount", "UpperAccountId", "dbo.AcmMasAccount", "AccountId");
        }
    }
}
